Alert
A short, important message.
Kobalte's Alert
is one element with role="alert", which the Kobalte layer binds, so
it needs no class at all.
alpha The class names and states here are stable. The look is not: these styles can change in a minor release, without a major version bump.
| Class | Does what |
|---|---|
alert | The message box |
alert-error | Recolours it with --error-color |
Basic
<div class="alert" role="alert">Your changes have been saved.</div>
<div class="alert alert-error" role="alert">We could not reach the server.</div>
<div class="alert" role="alert">Your changes have been saved.</div>
<div class="alert alert-error" role="alert">We could not reach the server.</div>
import { Alert } from "@kobalte/core/alert";
<Alert>Your changes have been saved.</Alert>
<Alert class="alert-error">We could not reach the server.</Alert>
<div role="alert">Your changes have been saved.</div>
<div role="alert" class="alert-error">We could not reach the server.</div>
There is no info, success or warning variant yet. The framework derives
everything from one --color plus --error-color, and
those variants need tokens it does not have.