Display a brief, important message in a way that attracts the user's attention without interrupting the user's task.
Import
import { Alert } from "@kobalte/core/alert";// orimport { Root } from "@kobalte/core/alert";// or (deprecated)import { Alert } from "@kobalte/core";Features
- Adhere to the WAI ARIA Alert design pattern.
Anatomy
The alert consists of :
- Alert: The root container for an alert.
<Alert />Example
Kobalte is going live soon, get ready!
import { Alert } from "@kobalte/core/alert";
export function BasicExample() { return ( <Alert class={style.alert}>Kobalte is going live soon, get ready!</Alert> );}.alert { border-radius: 6px; padding: 12px 16px; background-color: hsl(204 100% 97%); color: hsl(201 96% 32%); font-size: 16px;}
[data-theme*="dark"] .alert { background-color: hsla(202 80% 24% / 0.2); color: hsl(198 93% 60%);}API reference
Alert
Alert is equivalent to the Root import from @kobalte/core/alert (and deprecated Alert.Root).
Renders a div by default and support all its props.
Rendered elements
| Component | Default rendered element |
|---|---|
Alert | div |
Last updated: 7/16/26, 7:09 AM