# 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.

Package: `@kela-systems/ui-components` 4.1.0

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

Links (Kela sign-in needed): [Storybook](https://main--6af1efd9453270bb59a6c00c.chromatic.com/?path=/docs/components-alert--docs), [Source](https://github.com/Kela-Systems/kela/tree/main/packages/next/ui-components/src/alert), [Figma](https://www.figma.com/design/anhlwrbFM6mUiL0klxeK1I/ARK---Design-System?node-id=21-322)

## Examples

### Variants

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

```tsx
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

A `className` on a part adds layout only: placement, sizing and spacing. Pick a look with a variant.

### Alert

| Variant | Values | Default |
| --- | --- | --- |
| `variant` | `default`, `destructive`, `info`, `success`, `warning` | `default` |

Also takes the attributes of the HTML element it renders.

### AlertTitle

Also takes the attributes of the HTML element it renders.

### AlertDescription

Also takes the attributes of the HTML element it renders.

### AlertAction

Also takes the attributes of the HTML element it renders.
