Components

DhAlert

Inline callout for informing the user about a state, result, or required action. variant (Info / Success / Warning / Error / Primary / Neutral) fills its role colour at 15% over the surface with a 1 dp border in the same colour at 85% and the role colour as text — the same model as DhIcon boxed. Leading icon defaults per variant, optional title + body, up to two text actions, closable by default. Announces via a live region (assertive for warning/error).

Info (default)

The default variant. Zero-config DhAlert(text = …) renders an info callout.

Light dh-alert info (light theme)
Dark dh-alert info (dark theme)
DhAlert(text = "GPS is currently disabled.")

Success

Positive confirmation — an action completed or data was found.

Light dh-alert success (light theme)
Dark dh-alert success (dark theme)
DhAlert(
    variant = DhAlert.Variant.Success,
    title = "Saved",
    text = "The subject was found in the registry."
)

Warning

Caution — a potential issue the user should be aware of.

Light dh-alert warning (light theme)
Dark dh-alert warning (dark theme)
DhAlert(
    variant = DhAlert.Variant.Warning,
    title = "Almost full",
    text = "You are close to your storage limit."
)

Error

Failure — announced assertively to screen readers.

Light dh-alert error (light theme)
Dark dh-alert error (dark theme)
DhAlert(
    variant = DhAlert.Variant.Error,
    title = "Upload failed",
    text = "Check your connection and try again."
)

Primary

A brand-coloured callout using the primary role.

Light dh-alert primary (light theme)
Dark dh-alert primary (dark theme)
DhAlert(
    variant = DhAlert.Variant.Primary,
    title = "New feature",
    text = "Search is now available in the toolbar."
)

Neutral

Low-emphasis note on a surface-container tone.

Light dh-alert neutral (light theme)
Dark dh-alert neutral (dark theme)
DhAlert(
    variant = DhAlert.Variant.Neutral,
    title = "Note",
    text = "This recording is for training purposes."
)

With actions

Up to two text actions render below the body and fire their callbacks.

Light dh-alert with, actions (light theme)
Dark dh-alert with, actions (dark theme)
DhAlert(
    variant = DhAlert.Variant.Error,
    title = "Upload failed",
    text = "Check your connection and try again.",
    actions = listOf(
        DhAlert.Action("Retry", onClick = ::retry),
        DhAlert.Action("Dismiss", onClick = ::dismiss)
    ),
    onDismiss = { visible = false }
)