Skip to Content

Alert

The Alert component provides you with notifications and warnings for your application.

Live Examples

Live Example
☀️
Copy
View Code
import { Alert, AlertDescription, AlertTitle } from '@jarllyng/nostromo' export default function AlertExamples() { return ( <div className="space-y-4"> <Alert> <AlertTitle>Information</AlertTitle> <AlertDescription> This is an informative message. </AlertDescription>...

Import

import { Alert, AlertTitle, AlertDescription } from "@jarllyng/nostromo"; // or import { Alert, AlertTitle, AlertDescription } from "@jarllyng/nostromo/alert";

Usage

import { Alert, AlertTitle, AlertDescription } from "@jarllyng/nostromo"; export default function Example() { return ( <Alert variant="default"> <AlertTitle>Information</AlertTitle> <AlertDescription>This is an informative message.</AlertDescription> </Alert> ); }

Props

Alert

PropTypeDefaultRequiredDescription
variant"default" | "destructive" | "success" | "warning" | "info""default"NoVisual variant of the alert
size"sm" | "default" | "lg""default"NoSize of the alert
titlestringundefinedNoAlert title (alternative to AlertTitle component)
descriptionstringundefinedNoAlert description (alternative to AlertDescription component)
dismissiblebooleanfalseNoWhether the alert can be dismissed
onDismiss() => voidundefinedNoCallback when alert is dismissed
iconReact.ReactNodeundefinedNoCustom icon to display
classNamestringundefinedNoAdditional CSS classes
childrenReact.ReactNodeundefinedNoAlert content (AlertTitle, AlertDescription)

AlertTitle

PropTypeDefaultRequiredDescription
classNamestringundefinedNoAdditional CSS classes
childrenReact.ReactNodeundefinedNoTitle content

AlertDescription

PropTypeDefaultRequiredDescription
classNamestringundefinedNoAdditional CSS classes
childrenReact.ReactNodeundefinedNoDescription content
Last updated on