Jenga Error State
fun JengaErrorState(title: String, modifier: Modifier = Modifier, description: String? = null, icon: @Composable () -> Unit? = null, actionLabel: String? = null, onAction: () -> Unit? = null, actionVariant: JengaButtonVariant = JengaButtonVariant.Primary, colors: JengaStateColors = JengaStateDefaults.colors(), titleStyle: TextStyle = JengaStateDefaults.titleStyle, descriptionStyle: TextStyle = JengaStateDefaults.descriptionStyle, contentPadding: PaddingValues = JengaStateDefaults.contentPadding, spacing: Dp = JengaStateDefaults.spacing, actionSpacing: Dp = JengaTheme.components.state?.actionSpacing ?: spacing, actionSize: JengaButtonSize = JengaStateDefaults.actionSize)(source)
A centered error-state placeholder with a retry-style action.
Parameters
title
the headline (e.g. "Something went wrong").
modifier
the Modifier for this state.
description
optional supporting message.
icon
optional icon/illustration slot above the title.
action Label
optional action button label (e.g. "Retry"); shown with onAction.
on Action
called when the action is tapped.
action Variant
the action button's variant; defaults to Primary.
colors
the color set; defaults to JengaStateDefaults.colors.
title Style
the title text style.
description Style
the description text style.
content Padding
padding around the state.
spacing
the gap between the icon, title and description.
action Spacing
the gap above the action button; defaults to the theme's JengaStateStyle.actionSpacing, else spacing.
action Size
the action button size.
Samples
JengaErrorState(
title = "Couldn't load gates",
actionLabel = "Retry",
onAction = { },
)Content copied to clipboard