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 🙏

© 2024 – Pkg Stats / Ryan Hefner

placeholder-ui

v1.1.1

Published

A simple fast free user interface placeholder-ui plugin.

Downloads

27

Readme

Placeholder UI npm version

A simple fast free user interface placeholder-ui plugin.

Placeholder UI is a Image or Video placeholder user interface plugin. Placeholder UI is one-dependency module placeholder-ui dependent on Snizzle CSS selector Javascript engine. Placeholder UI that set default placeholder of all elements image/video of empty src. Placehlder UI in multiple features available like background, text color, cutom text, size preview and more.

downloads license install size author

⬇️ Install npm

# install locally (recommended)
npm install placeholder-ui --save

Including Placeholder UI

Below are some of the most common ways to include placeholder-ui.

Browser

Script tag

<!--Implement Snizzle CSS selector engine libraray in head section (Recomended)-->
<script src="https://cdn.jsdelivr.net/npm/snizzle/dist/snizzle-min.js"></script>

<!-- Implement placeholder-ui plugin from cdn link or your download destination -->
<script src="https://cdn.jsdelivr.net/npm/placeholder-ui/plugin/placeholder-ui-min.js"></script>

📖 Documentation

Public API

placeholder(Object options)

Parameters options: A placeholder Object {}

📚 Examples

HTML code

<!-- for image placeholder required image in [data-sizes] attribute -->
<img src="" alt="" data-sizes="200x300">
<!-- for video placeholder required video in [data-text] attribute -->
<video src="" data-text="Example Text"></video>

Javascript code

placeholder.set({
	background: "#677cbb",  // Placeholder background (optional)
	color: "#fff",          // Placholder text color (optional)
	sizePreview: true,      // true/false true for incling size preview (optinal)
	fontFamily: "Arial",    // Custom font-family (optinal)
	fontSize: 20,           // Custom font-size (optinal)
	fontWeight: 900,        // Custom font-weight (optinal)
	fontStyle: "normal"     // Custom font-style italic/oblique/normal (optinal)
});

🚀 CDN Links

🌐 Browsers support

Desktop

  • Chrome 16+
  • Edge 12+
  • Firefox 3.6+
  • Internet Explorer 7+1
  • Opera 11.6+
  • Safari 4.0+

1Workarounds for Internet Explorer 6 are still in the code but the browser is no longer actively tested.

Mobile

  • Android 2.3+
  • iOS 5.1+

To report a bug in any of these browsers, please add an issue with a test case from jsfiddle or jsbin.

Usage

HTML Code

<img src="" alt="Placeholder UI" data-sizes="222x333">

Javascript Code

placeholder.set({
	sizePreview: true,
	fontFamily: "monospace"
});

Preview:

image preview

Javascript Code

placeholder.set({
	background: "dark",
	sizePreview: true,
	color: "#ddd",
	fontFamily: "monospace"
});

Preview:

image preview

Javascript Code

placeholder.set({
	background: "#677cbb",
	color: "#fff",
	sizePreview: true,
	fontFamily: "Arial",
	fontSize: 20,	
	fontWeight: 900,
	fontStyle: "normal"
});

Preview:

image preview

HTML Code

<video src="" data-text="Shahzada Modassir\nVideo frame">

Javascript Code

placeholder.set({
	background: "#555555",
	fontWeight: 900,
	fontSize: 20,
	color: "#eeeeee",
	fontStyle: "italic"
});

Preview:

video preview