Alert

Displays a callout for user attention.

Overview

The Alert component displays important messages to users in a visually distinct way, supporting different severity levels with appropriate styling, iconography, and accessible markup to communicate the urgency and nature of the message effectively.

Usage

import { Alert, AlertDescription, AlertTitle } from "@tilt-legal/cubitt-components/primitives";
<Alert variant="default | destructive | info | warning | success">
  <Terminal />
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>
    You can add components and dependencies to your app using the cli.
  </AlertDescription>
</Alert>

Examples

Default

Info

Destructive

Warning

Success

Props

Alert

PropTypeDefaultDescription
variant"default" | "destructive" | "info" | "warning" | "success""default"The visual style variant of the alert
classNamestring-Additional CSS classes to apply to the alert
childrenReact.ReactNode-The content to display inside the alert
...propsReact.ComponentProps<"div">-All other standard div HTML attributes

AlertTitle

PropTypeDefaultDescription
classNamestring-Additional CSS classes to apply to the title
childrenReact.ReactNode-The title text content
...propsReact.ComponentProps<"div">-All other standard div HTML attributes

AlertDescription

PropTypeDefaultDescription
classNamestring-Additional CSS classes to apply to the description
childrenReact.ReactNode-The description text content
...propsReact.ComponentProps<"div">-All other standard div HTML attributes

Design Guidelines

Variant Usage

  • Default: General informational messages, neutral tone
  • Info: Helpful information, tips, or feature announcements
  • Warning: Important information that requires attention but isn't critical
  • Destructive: Error messages, failed operations, or critical issues
  • Success: Confirmation messages, successful operations, or positive feedback

On this page