Toast
A Toast component displays transient notifications. Uses heroui-native useToast hook for showing toast messages.
Demo
Demo Coming Soon
Toast examples will be available soon.
Usage
import { NButton, useNToast } from '@nayan-ui/react';const Toast = () => {const toast = useNToast();return (<NButton onClick={() => toast('This is a toast notification!', 'Success')}>Show Toast</NButton>);};export default Toast;
Attributes
| Name | Type | Default | Details |
|---|---|---|---|
| useNToast() | Hook | Returns toast methods: show, success, error, info, warning. | |
| show(options) | NToastShowOptions | Show a toast with type, message, title, icon, actionLabel, onActionPress. | |
| success(message, title?, icon?) | method | Show a success toast. | |
| error(message, title?, icon?) | method | Show an error toast. | |
| info(message, title?, icon?) | method | Show an info toast. | |
| warning(message, title?, icon?) | method | Show a warning toast. |