Alert
An Alert component displays important messages or notifications to users with different severity levels. Built on top of heroui-native.
Demo
Demo Coming Soon
Alert examples will be available soon.
Usage
import { NAlert, AlertTypes } from '@nayan-ui/react';const Alert = () => {return (<div><NAlert type={AlertTypes.DEFAULT} message="New version available!" className="mb-3" onClose={() => console.log('Alert closed')} /><NAlert type={AlertTypes.INFO} message="New version available!" className="mb-3" onClose={() => console.log('Alert closed')} /><NAlert type={AlertTypes.SUCCESS} message="New version available!" className="mb-3" onClose={() => console.log('Alert closed')} /><NAlert type={AlertTypes.WARNING} message="New version available!" className="mb-3" onClose={() => console.log('Alert closed')} /><NAlert type={AlertTypes.ERROR} title="Error!" message="New version available!" className="mb-3" onClose={() => console.log('Alert closed')} /></div>);};export default Alert;
Attributes
| Name | Type | Default | Details |
|---|---|---|---|
| title | string | Optional | Title for the alert. |
| description | string | Optional | Description text for the alert. |
| onClose | () => void | Optional | Callback to show a close button and handle dismissal. |
| className | string | ' ' | You can customise by passing tailwind classes. |
| titleClassName | string | ' ' | You can customise by passing tailwind classes. |
| descriptionClassName | string | ' ' | You can customise by passing tailwind classes. |