Feedback
SKSnackbar
SKSnackbar exposes a host and a controller so messages queue instead of overwriting each other. Duration, action and severity are part of the message contract.
Not yet released. SKSnackbar is planned for 1.6.0; the current published release (1.4.0-alpha01) ships SKText and SKTextField only.
Usage
SKSnackbar.kt
val host = rememberSKSnackbarHost()
host.show(
SKSnackbarMessage(
text = "Draft saved",
severity = SKSeverity.Success,
action = SKAction("Undo", onClick = ::undo)
)
)Props
| Prop | Type | Default | Description |
|---|---|---|---|
| text | String | — | Message body. |
| severity | SKSeverity | Info | Info, Success, Warning or Error. |
| action | SKAction? | null | Optional action. |
Accessibility
Messages are announced politely; action has an independent accessible label; duration extends under TalkBack.
Theming
Severity colours map to info, success, warning and error roles.
API surface
- SKSnackbar
- SKSnackbarHost
- SKSnackbarMessage
- SKSeverity