AlertBox
AlertBoxContextual feedback Turn an important message into a useful next step. Combine context, semantic color, and actions in one notice.
Actions & feedbackIn context
DESIGN SYSTEM
Semantic tones adapt to light and dark themes.
Every content feature is visible: eyebrow, title, badge, icon, body, metadata, and the actions slot.
<AlertBox
tone="success"
variant="spotlight"
eyebrow="DESIGN SYSTEM"
title="Make feedback useful"
badge="Tip"
icon="lucide:check"
meta="Semantic tones adapt to light and dark themes."
><p class="m-0">
Explain what happened, why it matters, and what the reader can do next.
</p>
<template #actions
><BtnLink
class="max-w-full ws-normal"
href="/guides/styling/semantic-tones/"
tone="success"
variant="outlineFill"
>Explore semantic tones</BtnLink></template>
</AlertBox> An actionable notice
Make the next step part of the message. The actions slot keeps it alongside the context.
COMPONENT GUIDANCE
Applies to both light and dark themes.
<AlertBox
tone="danger"
title="A shared design language"
eyebrow="COMPONENT GUIDANCE"
badge="Tip"
icon="lucide:check"
meta="Applies to both light and dark themes."
>
<p class="m-0">
Use semantic tones to communicate intent across your interface.
</p>
<template #actions>
<BtnLink
class="max-w-full ws-normal"
href="/components/layout/panel/"
variant="outlineFill"
>
Explore surfaces
</BtnLink>
</template>
</AlertBox> Choose the right urgency
Keep the message explicit so color is never the only signal.
<Flex direction="column">
<AlertBox tone="success" title="All checks passed" icon="tabler:circle-check">
The preview is ready for review.
</AlertBox>
<AlertBox tone="warning" title="Review required" icon="tabler:alert-triangle">
Check the content before publishing.
</AlertBox>
<AlertBox tone="danger" title="Build failed" variant="outline" icon="tabler:alert-circle">
Correct the source error and build again.
</AlertBox>
</Flex> All semantic tones
All ten tones, with visible labels. Explain intent through the message as well as color.
neutralaccentfeaturesecondarycustomghostinfosuccesswarningdangerAll values are shown together. Switch the site theme to compare light and dark rendering.
All visual variants
All eighteen treatments in the info tone. Content, icons, and actions share the same API across treatments.
solid surfacesurfaceAltspotlightglassflatflatAltflatSolid outlineFill outlinesubtlesubtleBtnlinksheen underlinerail bracketnoneAll values are shown together. Switch the site theme to compare light and dark rendering.
Variant modes
Stateless is the default. Stateful enables hover, focus, and active styling; it does not add action handlers. Hover or focus these notices to compare.
stateless stateful All values are shown together. Switch the site theme to compare light and dark rendering.
Behavior and accessibility
The eyebrow sits above the title, the badge stays beside the title, and metadata follows the actions. Empty actions take no space. The optional icon uses a solid frame in the selected tone; variant controls the surrounding Panel. This layout uses existing spacing, typography, wrapping, and visibility utilities.
AlertBox is a visual content component and does not automatically announce messages. For newly inserted urgent messages use an appropriate live region; for routine form feedback use FormStatus. Static notices should not interrupt screen-reader users.
API reference
AlertBox contract
Props below are the public template API. RefOrValue accepts a literal or a reactive ref; bind refs with a colon-prefixed attribute. Native attributes and events can be passed through the component root.
title
RefOrValue<string> - Default
not set
Visible heading. Choose a short title that identifies the content or task.
eyebrow
RefOrValue<string> - Default
not set
Short context above the heading, such as a category or release label.
badge
RefOrValue<string> - Default
not set
Optional compact label rendered with Badge.
meta
RefOrValue<string> - Default
not set
Secondary context such as an update time, limitation or reassurance.
tone
RefOrValue<SemanticTone> - Default
info
Semantic message tone. The default is info; use success, warning or danger only when that intent matches the text.
variant
RefOrValue<ComponentVariant> - Default
surface
Visual treatment. Accepts solid, surface, surfaceAlt, spotlight, glass, flat, flatAlt, flatSolid, outlineFill, outline, subtle, subtleBtn, link, sheen, underline, rail, bracket or none.
variantMode
RefOrValue<ComponentVariantMode> - Default
stateless
Use stateless for content surfaces; stateful enables the treatment’s hover, focus and active styles. It does not add interaction handlers.
icon
RefOrValue<string> - Default
not set
Registered SVG icon name. In browser apps, include the icon in the resolver passed to defineIconComponents.
Composition
Default slot: message body. actions: contextual links or buttons. Register defineAlertComponents with Panel, Flex, IconFrame, Icon and Badge dependencies; action components need their own registrations.