Components
Alert

Alert

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

Import

import { Alert, AlertTitle, AlertDescription } from '@nostromo/ui-core'
// or
import { Alert, AlertTitle, AlertDescription } from '@nostromo/ui-core/alert'

Usage

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

Live Examples

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

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