npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

placeholderify

v1.1.1

Published

A CSS library to make real HTML elements look like placeholders to simplify making placeholders of elements when the data is loading or reloading.

Readme

Placeholderify CSS library

A pure CSS library that automatically transforms real HTML elements into placeholders to simplify loading states, without requiring any JavaScript or efforts from your side.

The classic approach requires designing separate HTML code for placeholders when a component is in a loading state. However, this means you have to manage and sync two versions of the element: the real one and its placeholder representation.

This CSS library allows you to manage only one version of an HTML component - the real HTML code. The library automatically converts the design of the real HTML elements into a placeholder style.

All you have to do is apply the placeholderify CSS class to the root HTML element of your component, and all child elements will be converted into placeholders automatically.

Example

Let's imagine that you have a Bootstrap Card like this:

<div class="card">
  <img src="https://picsum.photos/600/400" class="card-img-top" alt="My image">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>

And to make a placeholder from it, you should just add a CSS library and the placeholdify class to the component:

<link rel="stylesheet" media="all" href="//murznn.github.io/placeholderify/dist/placeholderify.min.css" />

<div class="card placeholderify" >
  <img src="https://picsum.photos/600/400" class="card-img-top" alt="My image">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>

And that's it! 😎 No code duplication and no separate templates for placeholders!

To restore the real component, simply remove the placeholderify class.

Also, the library provides a placeholder for reloading element, when you don't need to hide the current content, for that cases include the reloadify.css file and use the reloadify class.

For a live demonstration and customization options, check out the example HTML file.

Usage

The library provides several separate CSS files with different approaches:

  • placeholderify.min.css and placeholderify class: a default approach which replaces everything inside the element by squares. And the shortened version: phfy.min.css and phfy class.

  • reloadify.min.css and reloadify class: an approach for reloading elements with actual content. Do not hides the texts, just adds a cover and animation. And the shortened version: rlfy.min.css and rlfy class.

  • placeholderify-img.min.css and placeholderify-img class: the same as placeholderify but keeps the images visible. And the shortened version: phfyi.min.css and phfyi class.

  • placeholderify-lines.min.css and placeholderify-lines class: coverts only inline elements to blocks. And the shortened version: phfyl.min.css and phfyl class.

Customization

The library supports customization through CSS variables. Here are the available options:

Opacity Settings

  • --placeholderify-opacity: Controls the opacity of placeholder elements (default: 0.33)

Background and Animation

  • --placeholderify-background-color: Sets the background color for text elements and images (default: currentcolor for text, black for images)
  • --placeholderify-cover-background: Defines the gradient used for the glow effect (default: linear gradient from transparent to semi-transparent white)
  • --placeholderify-cover-animation-name: The name of the animation for the glow effect (default: placeholderify-animation)
  • --placeholderify-cover-animation-duration: Duration of the glow animation (default: 0.5s)
  • --placeholderify-cover-animation-timing-function: Timing function for the glow animation (default: linear)

Usage Example:

.my-custom-placeholder {
  --placeholderify-opacity: 0.5;
  --placeholderify-background-color: #e0e0e0;
  --placeholderify-cover-animation-duration: 1s;
}

Excluding specific elements

To exclude specific elements from being transformed into placeholders, add the placeholderify-ignore class to them.

Keeping images

In some cases you probably want to keep images visible in the placeholders. To keep only specific images visible, use the placeholderify-ignore class. To make all images visible - use the placeholderify-img.css file and the placeholderify-img class. See example HTML file with keeping images.

Shorten names

To make your HTML code more compact, the library provides shorten versions of classes in the correspoindig CSS files:

  • placeholderify » phfy
  • reloadify » rlfy
  • placeholderify-img » phfyi
  • placeholderify-lines » phfyl