StylishAlert

fun StylishAlert(message: String, modifier: Modifier = Modifier, variant: StylishAlertVariant = StylishAlertVariant.Info, title: String? = null, onDismiss: () -> Unit? = null, action: @Composable () -> Unit? = null, containerColor: Color? = null, contentColor: Color? = null, shape: Shape = RoundedCornerShape(DefaultStylishDimensions.connectedCornerRadius), icon: @Composable () -> Unit? = null)

An inline alert/banner — the web "Alert" pattern from Ant Design, Chakra UI, and MUI.

Renders message (optionally with a title) in a tinted surface with a variant icon. Can be dismissed via onDismiss and can carry an action slot (e.g. a text button).

Parameters

message

The alert body text.

modifier

Modifier applied to the root surface.

variant

The semantic variant controlling colors and icon.

title

Optional bold heading rendered above message.

onDismiss

When non-null, a close button is shown and this callback is invoked on tap. The caller is responsible for hiding the alert.

action

Optional trailing slot (e.g. a TextButton-like action). Rendered after the message.

containerColor

Optional override for the alert background.

contentColor

Optional override for the foreground.

shape

Corner shape. Defaults to RoundedCornerShape with DefaultStylishDimensions.connectedCornerRadius.

icon

Optional leading icon. Defaults to the variant icon.