Alert

Calls attention to important contextual information. Pick the variant that matches the tone of the message: destructive for errors, warning for risks, success for confirmations, info for neutral notices.

React

Ready

Figma

React examples

Variants

The variant carries the meaning: neutral, information, success, warning or failure.

import { Alert, AlertDescription, AlertTitle, Stack } from "@kela-systems/ui-components";

export default function AlertVariants() {
  return (
    <Stack gap={3} className="w-full max-w-lg">
      <Alert>
        <AlertTitle>Mission plan saved</AlertTitle>
        <AlertDescription>Mission 12 is ready to launch from the north pad.</AlertDescription>
      </Alert>
      <Alert variant="info">
        <AlertTitle>Firmware update available</AlertTitle>
        <AlertDescription>Camera 4 can update the next time it is idle.</AlertDescription>
      </Alert>
      <Alert variant="success">
        <AlertTitle>Camera 4 reconnected</AlertTitle>
        <AlertDescription>The feed is live again.</AlertDescription>
      </Alert>
      <Alert variant="warning">
        <AlertTitle>Battery at 18%</AlertTitle>
        <AlertDescription>Hawk 2 returns to the dock at 15%.</AlertDescription>
      </Alert>
      <Alert variant="destructive">
        <AlertTitle>Link lost</AlertTitle>
        <AlertDescription>No telemetry from Hawk 2 for 30 seconds.</AlertDescription>
      </Alert>
    </Stack>
  );
}

Props

Alert

NameDefaultDescription
variant
"default" | "destructive" | "info" | "success" | "warning"
"default"

It also takes the attributes of the HTML element it renders.

AlertTitle

No props of its own. It also takes the attributes of the HTML element it renders.

AlertDescription

No props of its own. It also takes the attributes of the HTML element it renders.

AlertAction

No props of its own. It also takes the attributes of the HTML element it renders.

Read this page as Markdown

Search ARK

Find a page, a primitive or a component.