# rn-android-in-view

> Detects if view is at least 70% in the viewport

Latest version **1.0.1** (published 2021-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-android-in-view
pnpm add rn-android-in-view
yarn add rn-android-in-view
bun add rn-android-in-view
```

## 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 | 1.0.1 |
| Published | 2021-09-02 |
| First published | 2021-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Faraz Khan |
| Maintainers | frzkn |
| Keywords | react-native, react-visibility-sensor, react-native-visibility-sensor, react-native-visibility-tracker, visibility, visible, hidden, viewable, viewability, viewport, tracker |

## Links

- npm: https://www.npmjs.com/package/rn-android-in-view
- Repository: https://github.com/frzkn/rn-android-in-view
- Homepage: https://github.com/frzkn/rn-android-in-view/
- Issues: https://github.com/frzkn/rn-android-in-view/issues
- npm.io page: https://npm.io/package/rn-android-in-view

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

- 1.0.1 (latest) — 2021-09-02
- 1.0.0 — 2021-08-31
- 0.0.9 — 2021-08-30
- 0.0.8 — 2021-08-30
- 0.0.7 — 2021-08-30
- 0.0.6 — 2021-08-30
- 0.0.5 — 2021-08-30
- 0.0.4 — 2021-08-30
- 0.0.3 — 2021-08-30
- 0.0.2 — 2021-08-30
- 0.0.1 — 2021-08-30
- 0.0.0 — 2021-08-30

## README

# react-native-visibility-tracker

## WIP
**NOTICE** currently only android is supported so if in a rush [react-native-inviewport](https://github.com/yamill/react-native-inviewport).

Why not `react-native-inviewport`? It's `js` based. This library is native and can be used with `react-native-reanimated` or react-native's own `Animated` API.

PRs are welcome.


![demo](./docs/RNVT.gif)



## Getting started

`$ npm install react-native-visibility-tracker --save` **OR** `$ yarn add react-native-visibility-tracker`

## Usage
```ts
import VisibilityTracker from 'react-native-visibility-tracker';

function VisiblityTrackerItem(props: { index: number }) {
    const [isVisible, setVisible] = useState(false);
    return (
        <VisibilityTracker
            onVisibilityChanged={e => setVisible(e.nativeEvent.visible)}
        >
            <View
                collapsable={false}
                style={[{
                    backgroundColor: isVisible ? 'blue' : 'red',
                    height: 100,
                    margin: 5
                }]}
            >
                <Text>{props.index}</Text>
            </View>
        </VisibilityTracker>
    )
}

```

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