Skip to content

List ​

A grouped list container: a clipped, card-radius column of PrismListRows. Rows draw their own hairline separators and carry a leading slot, title (+ optional subtitle), trailing slot, and an optional disclosure chevron. Use it for settings, detail rows, and navigable items.

Import ​

kotlin
import io.github.heartcoolman.prism.ui.PrismList
import io.github.heartcoolman.prism.ui.PrismListRow

Basic usage ​

Drop PrismListRow children into a PrismList. Set showDivider = false on the last row to drop its hairline.

kotlin
PrismList {
    PrismListRow(
        title = "Row one",
        subtitle = "Subtitle",
        leading = { PrismIcon(PrismIcons.Star, contentDescription = null, size = 20.dp) },
        chevron = true,
        onClick = {},
    )
    PrismListRow(title = "Row two", trailing = { Text("Detail") }, showDivider = false)
}

Inset ​

Set inset = true to add horizontal margin around the grouped container.

kotlin
PrismList(inset = true) {
    PrismListRow(title = "Wi-Fi", trailing = { Text("On") }, showDivider = false)
}

API ​

PrismList ​

ParameterTypeDefaultDescription
modifierModifierModifierModifier applied to the container column.
insetBooleanfalseAdd horizontal margin around the group.
content@Composable ColumnScope.() -> Unit—The PrismListRows to lay out.

PrismListRow ​

ParameterTypeDefaultDescription
titleString—Primary text.
modifierModifierModifierModifier applied to the row column.
subtitleString?nullSecondary text below the title.
leading(@Composable () -> Unit)?nullLeading slot — icon or avatar.
trailing(@Composable () -> Unit)?nullTrailing slot — value text or control.
chevronBooleanfalseShow a trailing disclosure chevron.
onClick(() -> Unit)?nullMakes the row interactive (role = Button) when set.
showDividerBooleantrueDraw a bottom hairline; set false on the last row.

Released under the MIT License.