Drop placeholder images into an HTML prototype before real assets are ready, with dimensions shown automatically.
Create fluid percentage-based placeholder images that resize with their container during responsive design testing.
Apply custom colors or themes to placeholder images to match a design mockup's color palette.
Include the Holder script via CDN and use the holder.js URL pattern in image src attributes, no build step required.
Holder is a JavaScript library that generates image placeholders directly in the browser. When you are building a web page and don't have real images ready yet, you can drop a Holder placeholder into your HTML and it renders a grey (or colored) box with the image dimensions shown as text. Everything happens in the browser using SVG, so no extra server requests are needed. Using it is straightforward. You include the Holder script on your page, then write an image tag where the src attribute points to a special Holder URL like holder.js/300x200. Holder detects that pattern and replaces the image element with a rendered placeholder of the right size. You can also use data-src instead of src to avoid browser console errors from the placeholder URL. The library offers a range of customization options set through URL parameters. You can control background color, text color, font, font size, text alignment, and the text itself. Holder ships with six built-in color themes named sky, vine, lava, gray, industrial, and social. You can also define your own themes in JavaScript and apply them by name. Fluid placeholders are supported: specify dimensions in percentages and the placeholder resizes with its container. There is also programmatic access through a run() API, which lets you target specific image elements and inject placeholders from JavaScript rather than from HTML attributes. Holder is available through npm, yarn, Bower, cdnjs, and several other package managers and CDNs. It was used by Bootstrap version 3 and by many other open-source projects. The library has no external dependencies and is designed to stay small in file size.
← imsky on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.