# react-native-bottom-snackbar

> snackbar component for react-native (android/ios)

Latest version **1.3.1** (published 2022-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-bottom-snackbar
pnpm add react-native-bottom-snackbar
yarn add react-native-bottom-snackbar
bun add react-native-bottom-snackbar
```

## 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.3.1 |
| Published | 2022-06-18 |
| First published | 2022-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sandeep mishra |
| Maintainers | veerusandy |
| Keywords | react-native, react, react-native-bottom-snackbar, react-native-snackbar, bottom-snackbar, snackbar |

## Links

- npm: https://www.npmjs.com/package/react-native-bottom-snackbar
- Repository: https://github.com/FarMart-Tech/react-native-bottom-snackbar
- Homepage: https://github.com/FarMart-Tech/react-native-bottom-snackbar#readme
- Issues: https://github.com/FarMart-Tech/react-native-bottom-snackbar/issues
- npm.io page: https://npm.io/package/react-native-bottom-snackbar

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2022-06-18
- 1.3.0 — 2022-02-11
- 1.2.0 — 2022-02-08

## README

# react-native-bottom-snackbar

## A bottom snackbar to display messages on android / ios devices

### install
``npm install react-native-bottom-snackbar``
or
``yarn add react-native-bottom-snackbar``

#### How to use

import `AlertBottomSnackbar` component from `react-native-bottom-snackbar` and render it at the root level of the app.

open `App.js` or `App.tsx` (incase of typescript).

```jsx
import React from "react";
import { View } from "react-native";
import { AlertBottomSnackbar } from "react-native-bottom-snackbar";

const App = () => (
  <View style={{ flex: 1 }}>
    ----------
    ----------
    ----------
    <AlertBottomSnackbar />
  </View>
);

export default App;
```

That's it. Now you're ready to display snackbar from anywhere within your app.

```js
import { AlertBottomSnackbar } from "react-native-bottom-snackbar";

const someFunction = () => {
    // perform some operation
    --------------
    --------------
    --------------
    --------------
    AlertBottomSnackbar.show("this is test message", "info", () => {
        console.log("snackbar closed.");
    });
}
```
![demo screenshot](/screenshot/info-img.jpeg)

#### AlertBottomSnackbar Props
```jsx
style: ViewStyle (optional),
labelStyle: TextStyle (optional),
colorError:  string (default #B4161B),
colorNormal: string (default #242B2E),
colorSuccess: string (default #1FAA59),
colorInfo: string (default #1B98F5),
colorWarn: string (default #E07C24),
duration: number (default 3000 ms),
numberOfLines: number (default 2)
```

#### AlertBottomSnackbar Methods
```js
// to show the snackbar call show method.
const message = "this is test snackbar.";
const type = "error"; // "normal" | "error" | "success" | "info" | "warn" (default "normal")
const onClose = () => {
    -------
    -------
    -------
};
AlertBottomSnackbar.show(message, type, onClose);

// you can close the snackbar as well by just calling the close method.
AlertBottomSnackbar.close();
```

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