Jenga Empty State
fun JengaEmptyState(title: String, modifier: Modifier = Modifier, description: String? = null, icon: @Composable () -> Unit? = null, actionLabel: String? = null, onAction: () -> Unit? = null, actionVariant: JengaButtonVariant = JengaButtonVariant.Outline, 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 empty-state placeholder: optional icon, title, message, and action.
Parameters
title
the headline (e.g. "No scans yet").
modifier
the Modifier for this state.
description
optional supporting message.
icon
optional icon/illustration slot above the title.
action Label
optional action button label; shown with onAction.
on Action
called when the action is tapped.
action Variant
the action button's variant; defaults to Outline.
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
JengaEmptyState(
title = "No scans yet",
description = "Validated tickets appear here.",
actionLabel = "Scan a ticket",
onAction = { },
)Content copied to clipboard