Skip to content

Commit

Permalink
chore: more demos & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnartorfis committed Sep 5, 2024
1 parent 9dccc25 commit d135377
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Animated, customizable Toasts for React Native

![preview](https://github.com/user-attachments/assets/b0a95d89-3895-4d95-8a87-262fb7209805)

## Features

- Multiple variants, including `success`, `error`, `warning`
- Promise option with built in loading state
- Top or bottom positions
- Title and description
- Action button with callback
- Custom icons
- Dismissable with swipe, configurable left or up
- Highly performant using Reanimated 3
- Dark mode support
- Works with Expo
- NativeWind support
- Customizable
- Works outside of React components

## Installation

```sh
Expand Down
10 changes: 9 additions & 1 deletion example/src/ToastDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ export const ToastDemo: React.FC = () => {
console.log('Action pressed');
},
},
description: 'Your changes have been saved successfully',
description:
'Your changes have been saved successfully. This might go into a newline but we handle that by wrapping the text.',
variant,
});
}}
/>
<Button title="Show outside of a React component" onPress={handleToast} />
<Button
title="Toast with a promise"
onPress={() => {
Expand Down Expand Up @@ -138,3 +140,9 @@ export const ToastDemo: React.FC = () => {
</SafeAreaView>
);
};

const handleToast = () => {
toast('I am outside!', {
variant: ToastVariant.SUCCESS,
});
};

0 comments on commit d135377

Please sign in to comment.