Aliases
inline alert, notice
components / alert
Inline system message with tone-aware surfaces, optional actions, and dismiss handling for in-flow messaging.
Playground
Start here. Switch systems, interact with the shipped component, and let the rest of the page answer the why and how after the behavior clicks.
Cobalt
The crisp default DK action system: bright primary, roomy spacing, and a direct editorial rhythm.
Needs one more sign-off.
Overview
This section explains the intent of the component before the implementation details.
Aliases
inline alert, notice
Explore the math
Decision guide
Use these notes to decide quickly whether this is the right DK component for the job.
Decision guide
Do
Do not
Usage
Prefer these situations when choosing this component.
Usage
These patterns are better served by a different component or a simpler surface.
Anti-patterns
Migration notes
Anatomy
The anatomy explains which pieces matter to the recipe and accessibility model.
message shell
rootCarries tone, border, and background treatment.
supporting icon slot
iconOptional semantic cue before the copy.
message heading
titleShort summary of the status or issue.
supporting copy
descriptionClarifies impact or next steps.
follow-up actions
actionsOptional action area for repair or progression.
API
The docs contract distinguishes props, DOM events, and slots so integration behavior is explicit.
Props
| Name | Type | Default | Description |
|---|---|---|---|
tone | 'brand' | 'success' | 'warning' | 'danger' | 'brand' | Chooses the semantic message tone. |
title | string | — | Primary alert heading. |
description | string | — | Supporting alert copy. |
dismissible | boolean | false | Shows a dismiss affordance when true. |
onDismiss | (detail: { id?: string }) => void | — | Callback fired when the dismiss affordance is activated. |
theme | ThemeContract | — | Overrides the compiled DK theme used to resolve tokens and recipes for this component. |
Events
| Name | Payload | Description |
|---|---|---|
dismiss | { id?: string } | Fires when the user dismisses the component or one of its items. |
Slots
| Name | Description |
|---|---|
icon | Optional icon or symbol reinforcing the tone. |
actions | Optional inline follow-up actions. |
default | Optional custom body content when the title/description pair is not enough. |
Recipes
These notes summarize the intended recipe surface rather than exposing raw implementation detail first.
Variants
Sizes
States
Accessibility
This is the behavior the component promises to assistive tech and keyboard users today.
Semantics
Keyboard
Screen readers
Caveats
Checklist
Implementation
This section shows the representative compiled slot variables that the runtime consumes for the selected design system.
Implementation notes
Implementation checklist
Examples
Each example is intentionally practical, grouped by starter, common pattern, and edge-case coverage.
Starter
1 example
starter
Starter: inline noticeA neutral inline alert with one clear message.
Copy snippet
<Alert tone="brand" title="Review required" description="This workspace needs one more sign-off." />Common patterns
1 example
common
Common: inline repair actionAdd actions when the user can resolve the issue immediately.
Copy snippet
<Alert tone="warning" title="Missing details" description="Add the ship date before publishing."><svelte:fragment slot="actions"><Button size="sm">Add date</Button></svelte:fragment></Alert>Edge cases
1 example
edge
Edge: dismissible statusUse dismiss only when hiding the message is safe.
Copy snippet
<Alert tone="success" title="Changes saved" dismissible={true} />Verification
Proofs stay visible in the docs so the system shows what it can guarantee, not just what it can render.
tone=neutral
tone=brand
tone=success
tone=warning
tone=danger