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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kizito25/randomly

v1.15.0

Published

[![npm version](https://img.shields.io/npm/v/@kizito25/randomly)](https://www.npmjs.com/package/@kizito25/randomly) [![npm downloads](https://img.shields.io/npm/dm/@kizito25/randomly)](https://www.npmjs.com/package/@kizito25/randomly) [![license](https://

Downloads

419

Readme

🖼️ randomly

npm version npm downloads license

A lightweight utility to generate random gradient images and gradient backgrounds; great for placeholders, skeletons, or design prototyping.

Works in React via a ready-to-use <RandomImage /> component.


✨ Features

  • 🔀 Generate random CSS gradients (linear-gradient(...))
  • ⚛️ Drop-in <RandomImage /> React component
  • 🌈 Stylish placeholders while building your UI
  • 🪶 Zero dependencies for browser use

📦 Installation

npm install @kizito25/randomly

or

yarn add @kizito25/randomly

📚 Usage

🔵 1. Generate a Random CSS Gradient for the Browser

  • I have recentely added two new APIs, randomLightGradient() and randomSolidColors(). The are used exactly the same way as randomGradient()
import { randomGradient, randomLightGradient, randomSolidColors  } from '@kizito25/randomly';

 <div
    key={index}
    className="gradient"
    style={{ background: randomGradient() || randomLightGradient() || randomSolidColors()}}
    >
        <p>Div with a Gradient background</p>
    </div>

⚛️ 2. Use <RandomImage /> in React

import { RandomImage } from '@kizito25/randomly';

function App() {
  return (
    <div>
      <h2>Randomly:</h2>
       {new Array(10).fill(9).map((gradient, index) => (
          <div
            key={index}
            className=""
          >
            <RandomImage
              width={100}
              height={100}
              className=""
              alt="Random SVG Img"
              style={{
                borderRadius: "10px",
                boxShadow: "0 0 10px rgba(0, 0, 0, 0.5)",
                margin: "10px",
              }}
            />
          </div>
        ))}
    </div>
  );
}

🔧 Props

| Prop | Type | Default | Description | |-------------|----------|---------|--------------------------------------| | width | number | 300 | Width of the image | | height | number | 200 | Height of the image | | className | string | - | Optional CSS class for the <img /> element | | style | object | — | Optional Inline styles for the image | | ...rest | any | — | Optional Other standard <img> props |


📄 License

MIT © Kizito Ihugba


💡 Why Use randomly?

  • You're designing an app but don’t have images yet
  • You need elegant placeholders
  • You want some colour ✨ in your prototypes

randomly does all these for you.