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

react-native-ghostlayout

v0.3.0

Published

Composable skeleton loader components for React Native. Build loading placeholders with GhostText, GhostImage, GhostCircle and more.

Readme

react-native-ghostlayout

Skeleton loaders for React Native built by composing purpose-built components — one for text, one for images, one for circles, and so on. No automatic layout detection, no magic: you design the skeleton the same way you design the real UI.

Works with Expo and bare React Native. No native code required.


Installation

npm install react-native-ghostlayout
# or
yarn add react-native-ghostlayout

Quick start

Define a skeleton component that mirrors the structure of your real UI, then pass it to GhostLayout:

import {
  GhostLayout,
  GhostCircle,
  GhostText,
  GhostImage,
} from 'react-native-ghostlayout';

function ArticleCardSkeleton() {
  return (
    <View style={styles.card}>
      <GhostImage height={180} borderRadius={12} />

      <View style={{ flexDirection: 'row', gap: 12, padding: 16 }}>
        <GhostCircle size={40} />
        <View style={{ flex: 1, gap: 6 }}>
          <GhostText width="55%" />
          <GhostText width="35%" height={12} />
        </View>
      </View>

      <GhostText lines={3} style={{ paddingHorizontal: 16 }} />
    </View>
  );
}

function ArticleCard({ loading, data }) {
  return (
    <GhostLayout loading={loading} skeleton={<ArticleCardSkeleton />}>
      {/* Your real content here */}
      <RealCard data={data} />
    </GhostLayout>
  );
}

All bones inside a GhostLayout pulse in sync automatically.


Components

GhostLayout

The wrapper that switches between the skeleton and real content.

| Prop | Type | Default | Description | |------|------|---------|-------------| | loading | boolean | — | When true, renders the skeleton. When false, renders children. | | skeleton | ReactNode | — | The skeleton tree, composed from Ghost* components. | | children | ReactNode | — | The real content shown when loading is false. | | boneColor | string | '#E0E0E0' | Color of the skeleton bones. | | speed | number | 700 | Duration of one pulse half-cycle in milliseconds. | | style | ViewStyle | — | Style applied to the container. |


GhostText

One or more text-line placeholders.

| Prop | Type | Default | Description | |------|------|---------|-------------| | lines | number | 1 | Number of lines to render. | | width | DimensionValue | '100%' | Default width for each line. | | widths | DimensionValue[] | — | Per-line widths. Takes precedence over width. The last line falls back to '60%' if not specified. | | height | number | 14 | Height of each line in dp. | | gap | number | 8 | Vertical space between lines (only when lines > 1). | | style | ViewStyle | — | |

// Single line
<GhostText width="70%" />

// Multiple lines, last one shorter
<GhostText lines={3} />

// Custom width per line
<GhostText widths={['100%', '100%', '60%']} />

GhostImage

A rectangular placeholder for images, thumbnails, and banners.

| Prop | Type | Default | Description | |------|------|---------|-------------| | width | DimensionValue | '100%' | | | height | DimensionValue | 200 | | | borderRadius | number | 0 | | | style | ViewStyle | — | |

<GhostImage height={200} borderRadius={12} />

GhostCircle

A circular placeholder for avatars and icons.

| Prop | Type | Default | Description | |------|------|---------|-------------| | size | number | — | Width and height in dp. | | style | ViewStyle | — | |

<GhostCircle size={44} />

GhostBox

A generic rectangular bone for anything that doesn't fit the other components.

| Prop | Type | Default | Description | |------|------|---------|-------------| | width | DimensionValue | '100%' | | | height | DimensionValue | 40 | | | borderRadius | number | 4 | | | style | ViewStyle | — | |

<GhostBox width={120} height={32} borderRadius={8} />

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.

License

MIT © JohanAntunez