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

NameTypeDefaultDetails
titlestringOptionalTitle for the alert.
descriptionstringOptionalDescription text for the alert.
onClose() => voidOptionalCallback to show a close button and handle dismissal.
classNamestring' 'You can customise by passing tailwind classes.
titleClassNamestring' 'You can customise by passing tailwind classes.
descriptionClassNamestring' 'You can customise by passing tailwind classes.