π Flexible and customizable React toast notifications with support for positioning, custom rendering, click handlers, and duration control.
Modal | ||
---|---|---|
Ting_iOS.mp4 |
Ting_Android.mp4 |
Modal.mp4 |
yarn add @baronha/ting
or
npm i @baronha/ting
If you want to use Expo. Burnt is the solution for you.
cd ios && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --verbose
cd ios && pod install --verbose
import { toast } from '@baronha/ting';
// ...
const options = {
title: 'Done π',
message: 'Successful!!',
};
toast(options); // easy to use
import { toast } from '@baronha/ting';
// ...
const options = {
// ...
title: "Vietnamese Gangz π",
message: "Anh em tao lΓ Vietnamese Gangz",
titleColor: '#D60A2E',
icon: {
uri: require('./vietnam.png'), // or remote
size: 24,
},
};
toast(options); // icon is π»π³
import { alert } from '@baronha/ting';
// ...
const options = {
title: 'Done π',
message: 'Successful!!',
};
alert(options); // easy to use
Property | Type | Default value | Platform | Toast | Alert | Description |
---|---|---|---|---|---|---|
title |
string | null | β | β | ||
message |
string | null | β | β | ||
titleColor |
string | null | β | β | ||
messageColor |
string | null | β | β | ||
icon |
object |
null | β | β | See Icon | |
preset |
string | done |
β | β | Toast: done, error, none .Alert: done, error, none, spinner |
|
duration |
number | 3 |
β | β | The lifetime of the toast (seconds) | |
titleColor |
string | null | β | β | ||
shouldDismissByDrag |
boolean | true | β | The behavior on Android is click |
||
position |
string | top |
β | Toast is displayed from top or bottom |
||
haptic |
string | null | β | success, warning, error, none |
||
shouldDismissByTap |
boolean | true | β | |||
borderRadius |
number | null | β | |||
blurBackdrop |
number | null | β | |||
backdropOpacity |
number | null | β | |||
backgroundColor |
string | #ffffff | β | β |
icon | Type | Default value | Platform |
---|---|---|---|
uri |
string | null | |
size |
number | null |
-
shouldDismissByDrag
on Android -
callback
- Initialize for the first time
-
tintColor
for icon -
backgroundColor
We're trying to improve performance. If you have a better solution, please open a issue or pull request. Best regards!
See the contributing guide to learn how to contribute to the repository and the development workflow.