Jenga Key Value Row
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.
Parameters
the key text.
the value text.
the Modifier for this row.
the value's TextStyle; pass JengaTheme.typography.mono for codes.
optional tone that colors the value (e.g. success for "Paid").
the row's weight; see JengaKeyValueEmphasis.
optional end slot after the value (e.g. a copy button).
optional click handler; makes the whole row clickable.
the maximum lines for value before it is truncated.
the largest share of the row width the value may take.
the minimum row height; defaults to the theme's JengaKeyValueRowStyle.minHeight, else JengaKeyValueRowDefaults.MinHeight.
inner padding around the label and value.
the color set; defaults to JengaKeyValueRowDefaults.colors.
the label's TextStyle.
Samples
Column(
content = {
JengaKeyValueRow(
label = "Serial number",
value = "SN-0042-7781",
valueStyle = JengaTheme.typography.mono,
)
JengaDivider()
JengaKeyValueRow(
label = "Total",
value = "KES 12,450",
emphasis = JengaKeyValueEmphasis.Total,
)
},
)