# react-native-hs-toast

> toast to ios and android - react native. Pure javascript

Latest version **1.0.0** (published 2023-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-hs-toast
pnpm add react-native-hs-toast
yarn add react-native-hs-toast
bun add react-native-hs-toast
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-10-29 |
| First published | 2023-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Henrique Silva |
| Maintainers | henrry-sillva |
| Keywords | toast react native, toast, react-native, ios, android, react-component |

## Links

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

## Dependencies (2)

- [react-native-uuid](https://npm.io/package/react-native-uuid.md) ^2.0.1
- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) ^5.0.1

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-10-29

## README

## HS TOAST
### ~Lib created to react native. It works in platform ios and android. Pure(100%) writing in javascript. 

##### Preview

![preview](preview.gif)

> ### How to use

first install package: `yarn add hs-toast` or `npm install hs-toast`
now you need install [react-native-root-siblings](https://github.com/magicismight/react-native-root-siblings)
finally import the component RootSiblingParent in your app root and call component in higher hierarchy.


> ### exemple of use

```jsx 
// app.tsx or index.tsx
export default function App(){

    return(
        <RootSiblingParent>
        <View>
        /** contents */
        </View>
        </RootSiblingParent>
    )
}
```

```jsx 
// home.tsx // screen main
import { Button,  View, SafeAreaView } from 'react-native'
import {MaterialCommunityIcons} from '@expo/vector-icons'
import {Toast} from 'hs-toast';

export default function Main(){

    function _handleShowToast(){
        Toast.show('Toast message example!')
    }

        function _handleShowToastWithOptions(){
        Toast.show('Toast message example!', {
            duration: Toast.Duration.LONG,
            position: Toast.Position.BOTTOM,
            Icon : (props) => <MaterialCommunityIcons name='face-man' {...props} />
        })
    }

    return(
        <View>
           <Button title='show toast' onPress={_handleShowToast} />
           <Button title='show custom toast' onPress={_handleShowToastWithOptions} />
        </View>
    )
}
```

##### Optional you can the object of settings to the second params of method static show. The following properties are accept. All properties are optional.

 **Property** | **description**           | **type**             | **default**                             
:------------:|:-------------------------:|:--------------------:|:---------------------------------------:
 **duration** | Toast display time        | enum Toast.Duration  | undefined - You need call method hide() 
 **position** | Toast position in display | enum Toast.Position  | Toast.Position.BOTTOM                   
 **Icon**     | Custom icon to toast      | TypeToast.IconOption | null

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