Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Alert

    A message that stays in the page until it stops being true: a warning about a form, a notice about the account, a note above a table. For something brief that appears after an action, use Snackbar.

    Install

    npx shadcn@latest add @nelumbo/alert

    Variants

    Neutral by default; tonal colors when the message carries meaning. Each variant picks its own icon. Destructive is announced at once (role alert); the others are announced politely (role status).

    Heads up
    You can change this later in Settings.
    Scheduled maintenance
    The dashboard will be read-only on Sunday from 02:00 to 03:00.
    Backup finished
    All 1,240 files are safe in the cloud.
    Storage almost full
    You've used 92% of your space. Free some up to keep syncing.
    What's new
    Spring palettes and the new date picker are here.

    Title only, and icons

    A title alone makes a one-line notice. icon replaces the symbol, and icon={false} removes it.

    Your trial ends in 3 days
    Synced just now
    No icon, when the color is enough
    Tip
    Press / anywhere to start searching.

    With actions

    One or two buttons, with the action prop or an AlertAction child. Ghost and outline buttons take the alert's text color.

    Unsaved changes
    You have edits in 3 files that haven't been published.

    Dismissible

    onDismiss adds a close button. The alert collapses and fades out (just a fade with reduced motion), then the callback runs.

    New comments
    Maya left 2 comments on your draft.
    Invite sent

    layout="banner" is full width with square corners, for the top of a page or a card. Actions sit on the right on wide screens and drop below the text on narrow ones.

    A new version is available
    Update to get the latest fixes. It takes about a minute.
    Page content sits below the banner.
    Spring sale: 20% off until Sunday

    Usage

    import { Alert, AlertAction, AlertDescription, AlertTitle } from "@/components/ui/alert"​// shadcn's API<Alert variant="destructive">  <AlertTitle>Payment failed</AlertTitle>  <AlertDescription>Your card was declined.</AlertDescription></Alert>​// Nelumbo: tonal variants, actions, dismiss, banner<Alert variant="warning" onDismiss={() => setSeen(true)}>  <AlertTitle>Storage almost full</AlertTitle>  <AlertDescription>You've used 92% of your space.</AlertDescription>  <AlertAction>    <Button size="sm">Upgrade</Button>  </AlertAction></Alert>​<Alert layout="banner" variant="info" action={<Button size="sm">Details</Button>}>  <AlertTitle>Scheduled maintenance on Sunday</AlertTitle></Alert>

    Props

    PropTypeDefaultNotes
    variant"default" | "info" | "success" | "warning" | "destructive" | "brand""default"Neutral, tinted with a status color, or brand (a solid fill, distinct from info for any brand accent)
    layout"inline" | "banner""inline"Banner: full width, square, actions on the right from sm up
    iconIconName | ReactNode | falseper variantinfo, check_circle, warning, error, campaign; default has none
    actionReactNodeOne or two buttons. <AlertAction> children work the same
    onDismiss() => voidAdds a close button; runs after the alert animates out
    dismissLabelstring"Dismiss"Name of the close button
    rolestring"alert" for destructive, else "status"Override when needed