Package-level declarations

List rows: JengaListItem, JengaKeyValueRow, and rows with a control (JengaCheckboxListItem, JengaRadioListItem).

Types

Link copied to clipboard

Where a selection list item draws its control.

Link copied to clipboard
Link copied to clipboard
class JengaKeyValueRowColors(val label: Color, val value: Color, val trailing: Color)

Resolved colors for a JengaKeyValueRow. Override via JengaKeyValueRowDefaults.colors.

Link copied to clipboard
Link copied to clipboard
class JengaKeyValueRowStyle(val minHeight: Dp? = null, val contentPadding: PaddingValues? = null, val labelStyle: TextStyle? = null, val valueStyle: TextStyle? = null)

Theme-wide style for every JengaKeyValueRow, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.keyValueRow. A null value keeps Jenga's default; arguments passed to a call still win.

Link copied to clipboard
class JengaListItemColors(val container: Color, val headline: Color, val supporting: Color, val leadingTrailing: Color, val disabledHeadline: Color = headline.copy(alpha = 0.38f), val disabledSupporting: Color = supporting.copy(alpha = 0.38f), val disabledLeadingTrailing: Color = leadingTrailing.copy(alpha = 0.38f))

Resolved colors for a JengaListItem. Override via JengaListItemDefaults.colors.

Link copied to clipboard

Defaults and token mappings for JengaListItem.

Link copied to clipboard
class JengaListItemStyle(val minHeight: Dp? = null, val contentPadding: PaddingValues? = null, val contentSpacing: Dp? = null, val headlineStyle: TextStyle? = null, val supportingStyle: TextStyle? = null, val colors: JengaListItemColors? = null)

Theme-wide style for every JengaListItem, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.listItem. A null value keeps Jenga's default; arguments passed to a JengaListItem call still win.

Link copied to clipboard

Defaults for JengaRadioListItem and JengaCheckboxListItem. The composable members follow the theme's JengaSelectionListItemStyle, then its list item style.

Link copied to clipboard
class JengaSelectionListItemStyle(val minHeight: Dp? = null, val contentPadding: PaddingValues? = null, val contentSpacing: Dp? = null, val headlineStyle: TextStyle? = null, val supportingStyle: TextStyle? = null, val colors: JengaListItemColors? = null, val radioSize: Dp? = null, val checkboxShape: Shape? = null)

Theme-wide style for every JengaRadioListItem and JengaCheckboxListItem, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.selectionListItem. A null value falls back to the theme's list item style, then to Jenga's default; arguments passed to a call still win.

Functions

Link copied to clipboard
fun JengaCheckboxListItem(headline: String, checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, supporting: String? = null, enabled: Boolean = true, controlPosition: JengaControlPosition = JengaControlPosition.Leading, minHeight: Dp = JengaSelectionListItemDefaults.minHeight, contentPadding: PaddingValues = JengaSelectionListItemDefaults.contentPadding, contentSpacing: Dp = JengaSelectionListItemDefaults.contentSpacing, headlineStyle: TextStyle = JengaSelectionListItemDefaults.headlineStyle, supportingStyle: TextStyle = JengaSelectionListItemDefaults.supportingStyle, headlineMaxLines: Int = 1, supportingMaxLines: Int = 1, trailingContent: @Composable () -> Unit? = null, checkboxShape: Shape = JengaSelectionListItemDefaults.checkboxShape, colors: JengaListItemColors = JengaSelectionListItemDefaults.colors(), checkboxColors: JengaCheckboxColors = JengaCheckboxDefaults.colors(), loading: Boolean = false)

A list row with a JengaCheckbox, for picking several options from a list. The whole row is the touch target and is announced as a checkbox.

Link copied to clipboard
fun JengaKeyValueRow(label: String, value: String, modifier: Modifier = Modifier, valueStyle: TextStyle = JengaKeyValueRowDefaults.valueStyle, valueTone: JengaBadgeTone? = null, emphasis: JengaKeyValueEmphasis = JengaKeyValueEmphasis.Default, trailingContent: @Composable () -> Unit? = null, onClick: () -> Unit? = null, valueMaxLines: Int = Int.MAX_VALUE, valueMaxWidthFraction: Float = JengaKeyValueRowDefaults.ValueMaxWidthFraction, minHeight: Dp = JengaTheme.components.keyValueRow?.minHeight ?: JengaKeyValueRowDefaults.MinHeight, contentPadding: PaddingValues = JengaKeyValueRowDefaults.contentPadding, colors: JengaKeyValueRowColors = JengaKeyValueRowDefaults.colors(emphasis, valueTone), labelStyle: TextStyle = JengaKeyValueRowDefaults.labelStyle)

A label and its value on one row: the label at the start, the value aligned to the end, taking up to valueMaxWidthFraction of the row and wrapping up to valueMaxLines lines before it is truncated with an ellipsis. Stack these for detail and summary sections (serial numbers, dates, amounts). Place a io.github.joelkanyi.jenga.component.divider.JengaDivider above a total row to set it apart.

Link copied to clipboard
fun JengaListItem(headline: AnnotatedString, modifier: Modifier = Modifier, supporting: String? = null, supportingContent: @Composable () -> Unit? = null, leadingContent: @Composable () -> Unit? = null, trailingContent: @Composable () -> Unit? = null, onClick: () -> Unit? = null, enabled: Boolean = true, headlineMaxLines: Int = 1, supportingMaxLines: Int = 1, minHeight: Dp = JengaTheme.components.listItem?.minHeight ?: JengaListItemDefaults.MinHeight, contentPadding: PaddingValues = JengaListItemDefaults.contentPadding, headlineStyle: TextStyle = JengaListItemDefaults.headlineStyle, supportingStyle: TextStyle = JengaListItemDefaults.supportingStyle, contentSpacing: Dp = JengaListItemDefaults.contentSpacing, verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, colors: JengaListItemColors = JengaListItemDefaults.colors())

A JengaListItem whose headline is styled text (e.g. a monospaced id beside plain words).

fun JengaListItem(headline: String, modifier: Modifier = Modifier, supporting: String? = null, supportingContent: @Composable () -> Unit? = null, leadingContent: @Composable () -> Unit? = null, trailingContent: @Composable () -> Unit? = null, onClick: () -> Unit? = null, enabled: Boolean = true, headlineMaxLines: Int = 1, supportingMaxLines: Int = 1, minHeight: Dp = JengaTheme.components.listItem?.minHeight ?: JengaListItemDefaults.MinHeight, contentPadding: PaddingValues = JengaListItemDefaults.contentPadding, headlineStyle: TextStyle = JengaListItemDefaults.headlineStyle, supportingStyle: TextStyle = JengaListItemDefaults.supportingStyle, contentSpacing: Dp = JengaListItemDefaults.contentSpacing, verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, colors: JengaListItemColors = JengaListItemDefaults.colors())

A single row in a list: a headline, optional supporting line, and optional leading/trailing slots (icons, avatars, controls).

Link copied to clipboard
fun JengaRadioListItem(headline: String, selected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, supporting: String? = null, enabled: Boolean = true, controlPosition: JengaControlPosition = JengaControlPosition.Leading, minHeight: Dp = JengaSelectionListItemDefaults.minHeight, contentPadding: PaddingValues = JengaSelectionListItemDefaults.contentPadding, contentSpacing: Dp = JengaSelectionListItemDefaults.contentSpacing, headlineStyle: TextStyle = JengaSelectionListItemDefaults.headlineStyle, supportingStyle: TextStyle = JengaSelectionListItemDefaults.supportingStyle, headlineMaxLines: Int = 1, supportingMaxLines: Int = 1, radioSize: Dp = JengaSelectionListItemDefaults.radioSize, colors: JengaListItemColors = JengaSelectionListItemDefaults.colors(), trailingContent: @Composable () -> Unit? = null)

A list row with a JengaRadioButton, for picking one option from a list. The whole row is the touch target and is announced as a radio button.