# rn-placeholder

> Display some placeholder stuff before rendering your text or media content in React Native

Latest version **3.0.3** (published 2020-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-placeholder
pnpm add rn-placeholder
yarn add rn-placeholder
bun add rn-placeholder
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2020-09-18 |
| First published | 2017-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 48.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2125 |
| Author | Marvin FRACHET |
| Maintainers | skahrz |
| Keywords | react-native, ios, android, expo |

## Links

- npm: https://www.npmjs.com/package/rn-placeholder
- Repository: https://github.com/mfrachet/rn-placeholder
- Issues: https://github.com/mfrachet/rn-placeholder/issues
- npm.io page: https://npm.io/package/rn-placeholder

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2020-09-18
- 3.0.2 — 2020-09-18
- 3.0.1 — 2020-06-09
- 3.0.0 — 2019-08-07
- 3.0.0-alpha.5 — 2019-08-01
- 3.0.0-alpha.4 — 2019-07-31
- 3.0.0-alpha.3 — 2019-07-18
- 3.0.0-alpha.2 — 2019-07-16
- 3.0.0-alpha.1 — 2019-07-15
- 2.0.0 — 2019-04-27
- 1.3.3 — 2019-01-18
- 1.3.2 — 2018-12-10
- 1.3.1 — 2018-12-10
- 1.3.0 — 2018-10-10
- 1.2.0 — 2017-12-20
- … 10 more at https://npm.io/package/rn-placeholder/versions

## README

[![Build Status](https://travis-ci.org/mfrachet/rn-placeholder.svg?branch=master)](https://travis-ci.org/mfrachet/rn-placeholder)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Display some placeholder stuff before rendering your text or media content in React Native. Compatible with [Expo](https://expo.io/) and [react-native-web](https://github.com/necolas/react-native-web).

- [Snack application **with copy to clipboard!**](https://snack.expo.io/@mfrachet/84bb31)
- [Usage with react-native-web](https://mfrachet.github.io/rn-placeholder)
- [The N Props syndrome (post)](https://mfrachet.github.io/the-n-props-syndrome): explaining the transition between v2 and v3

---

![Image of the placeholder in action](./assets/placeholder.gif)

# Usage

## Installation

```javascript
$ yarn add rn-placeholder
```

## In your code

```jsx
import {
  Placeholder,
  PlaceholderMedia,
  PlaceholderLine,
  Fade
} from "rn-placeholder";

const App = () => (
  <Placeholder
    Animation={Fade}
    Left={PlaceholderMedia}
    Right={PlaceholderMedia}
  >
    <PlaceholderLine width={80} />
    <PlaceholderLine />
    <PlaceholderLine width={30} />
  </Placeholder>
);
```

The v3 comes with an example app that provides different stories and example of the library:

- [Stories for elements](./example/storybook/stories/elements.tsx)
- [Stories for animations](./example/storybook/stories/animations.tsx)
- [Stories for customizing elements](./example/storybook/stories/customizeElements.tsx)
- [Stories for customizing animations](./example/storybook/stories/customizeAnimation.tsx)

## Run the example apps

_You can modify any call of `yarn` by `npm install`_

### To start the mobile app:

```sh
$ git clone https://github.com/mfrachet/rn-placeholder
$ cd rn-placeholder
$ yarn
$ cd ./example && yarn && yarn start
```

### To start the web app:

```sh
$ git clone https://github.com/mfrachet/rn-placeholder
$ cd rn-placeholder
$ yarn
$ cd ./example-web && yarn && yarn start
```

The web app is also available in this github pages: https://mfrachet.github.com/rn-placeholder.

## V3 features

- Rewritten in [Typescript](https://www.typescriptlang.org/)
- Less code, more fun 😎
- API [Suspense](https://reactjs.org/docs/code-splitting.html#suspense) oriented
- [New animations](./src/animations)

---
_Source: https://npm.io/package/rn-placeholder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
