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

react-fake-content

v2.0.0

Published

Simple and easy group of components using only CSS to generate content placeholder.

Downloads

255

Readme

react-fake-content

https://nodei.co/npm/react-fake-content.png?downloads=true&downloadRank=true&stars=true

minified + gzip npm version npm download GitHub stars GitHub issues GitHub contributors MIT license

Demo

https://cezarsmpio.github.io/react-fake-content/

Install

npm install react-fake-content --save

Usage

👉 React 16.8+ is required. This library uses React Hooks.

import { Circle } from 'react-fake-content';

function Avatar(props) {
    if (!props.loaded) {
        return <Circle size="40px" />
    }

    return <img src={props.url} width="40" height="40">
}

Components

✅ All components support server-side rendering!

<Rectangle />

import { Rectangle } from 'react-fake-content';

function Component(props) {
  return <Rectangle width="400px" height="250px" />;
}

width: string - required

CSS unit to define the widht of the component.

height: string - required

CSS unit to define the height of the component.

<Circle />

import { Circle } from 'react-fake-content';

function Component(props) {
  return <Circle size="25px" />;
}

size: string - 60px

CSS unit to define either width and height of the component.

<Line />

import { Line } from 'react-fake-content';

function Component(props) {
  return (
    <CodeBlock>
      <Line width="100%" height="12px" />
      <Line width="95%" height="12px" />
      <Line width="98%" height="12px" />
      <Line width="100%" height="12px" />
      <Line width="92%" height="12px" />
    </CodeBlock>
  );
}

width: string - 100%

CSS unit to define width of the component.

height: string - 15px

CSS unit to define height of the component.

<Square />

import { Square } from 'react-fake-content';

function Component(props) {
  return <Square size="45px" />;
}

size: string - 60px

CSS unit to define either width and height of the component.

Properties

All properties below are applicable for all components.

animation: boolean - true

false to disable animation.

animationDuration: number - 1000

Number in miliseconds.

animationName: string - reactFakeContentAnimation

CSS animation name.

primaryColor: string - #efefef

CSS unit to define the primary color of the component gradient.

secondaryColor: string - #ddd

CSS unit to define the secondary color of the component gradient.

style: object - {}

A list of CSS properties to be added into the component.

as: string - div

Changes the component element to be rendered.

responsive: bool - true

The component will adapt to its container size if the value is true. Otherwise, it won't resize itself.

inline: bool - false

By default, all components are block. If you want them rendered as inline-block, use inline={true} or style={{ display: 'inline-block' }}.

Browser support

  • Chrome ✅
  • Firefox ✅
  • Safari ✅
  • Opera ✅
  • Edge 15+ ✅
  • IE11+ ✅
  • iOS 9+ ✅
  • Android 5+ ✅

Including animations!