Show HN: PlaceholderJS – Simple and Lightweight Placeholders
4 points
10 days ago
| 2 comments
| placeholderjs.com
| HN
Hey all! My name is Owen, I'm the developer behind PlaceholderJS. Since the demise of placeholder.com, I wanted to be able to use placeholders on my React projects via a package so that way I don't have to worry about these services shutting down again in the future.

Additionally, for our non-React developers out there, I created a simple CDN that functions similarly via the PlaceholderJS.com domain.

In the future, I'd like to add support for more frameworks, placeholder text, additional customization, etc.

I'm looking to improve this and continue to support it and would love your feedback.

duncanmeech
10 days ago
[-]
Up there with leftpad as a library you probably don't need. https://qz.com/646467/how-one-programmer-broke-the-internet-...
reply
moritzwarhier
10 days ago
[-]
What's the advantage of this over sth like

   const Placeholder = ({background = "gray", width = "100%", height = "200px", text}) => (<div style={{background, width, height, display: "flex"}}>
<span style={{margin: "auto"}}>{text ?? `${width} x ${height}`}</span> </div>)

Would never install a package for this, and for local dev, there are more than enough other placeholder services left that allow hotlinking.

If it's fun to build, cool, but I would never recommend anyone to add dependencies for things like this.

reply