# react-native-fade

> Fade components in and out in React Native with just a boolean.

Latest version **2.1.1** (published 2021-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-fade
pnpm add react-native-fade
yarn add react-native-fade
bun add react-native-fade
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-10-07 |
| First published | 2018-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | jonsamp |
| Maintainers | jonsamp |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-fade
- Repository: https://github.com/jonsamp/react-native-fade
- Homepage: https://github.com/jonsamp/react-native-fade#readme
- Issues: https://github.com/jonsamp/react-native-fade/issues
- npm.io page: https://npm.io/package/react-native-fade

## 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

- 2.1.1 (latest) — 2021-10-07
- 2.0.0-beta.0 (beta) — 2019-12-30
- 2.1.0 — 2021-10-07
- 2.0.2 — 2020-08-02
- 2.0.1 — 2019-12-30
- 2.0.0 — 2019-12-30
- 1.0.3 — 2018-12-07
- 1.0.2 — 2018-10-04
- 1.0.1 — 2018-10-01

## README

# react-native-fade

A wrapper component to fade its children in and out based on a boolean.

![Fade example gif](https://user-images.githubusercontent.com/6455018/71566445-b0982780-2a85-11ea-96f9-2519dc33930d.gif)

## Installation

```bash
# yarn
yarn add react-native-fade

# npm
npm install react-native-fade --save
```

Then, import with:

```js
import Fade from 'react-native-fade';
```

Note:
You may also need to install `react-native-reanimated`.

## Usage

Example:

```js
import React, { useState } from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import Fade from 'react-native-fade';

export default function App() {
  const [visible, setVisible] = useState(false);
  return (
    <View>
      <Button
        onPress={() => setVisible(!visible)}
        title={visible ? 'Hide text' : 'Show text'}
      />
      <Fade visible={visible} direction="up">
        <Text>I fade in</Text>
      </Fade>
    </View>
  );
}
```

You can see a full example app inside the /example folder!

## Props

| Prop        | Required? | Type                         | Description                                                                                                                                     |
| ----------- | --------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `visible`   | false     | boolean                      | Show the children of `<Fade>`.                                                                                                                  |
| `direction` | false     | string                       | Can be `"up"` or `"down"`. When the child component fades in there's an optional subtle translation that you can apply with `"up"` or `"down"`. |
| `duration`  | false     | number                       | The amount of time in milliseconds the fade transition should take.                                                                             |
| `style`     | false     | React Native Style or Object | Applies style a view around the faded child components                                                                                          |

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