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

NameTypeDefaultDetails
useNToast()HookReturns toast methods: show, success, error, info, warning.
show(options)NToastShowOptionsShow a toast with type, message, title, icon, actionLabel, onActionPress.
success(message, title?, icon?)methodShow a success toast.
error(message, title?, icon?)methodShow an error toast.
info(message, title?, icon?)methodShow an info toast.
warning(message, title?, icon?)methodShow a warning toast.