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.


DhAlert(text = "GPS is currently disabled.")Success
Positive confirmation — an action completed or data was found.


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.


DhAlert(
variant = DhAlert.Variant.Warning,
title = "Almost full",
text = "You are close to your storage limit."
)Error
Failure — announced assertively to screen readers.


DhAlert(
variant = DhAlert.Variant.Error,
title = "Upload failed",
text = "Check your connection and try again."
)Primary
A brand-coloured callout using the primary role.


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.


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.


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 }
)