JengaListSheet

fun JengaListSheet(onDismissRequest: () -> Unit, title: String, modifier: Modifier = Modifier, sheetState: JengaSheetState = rememberJengaSheetState(), subtitle: String? = null, headerAction: @Composable () -> Unit? = null, footer: @Composable RowScope.() -> Unit? = null, titleStyle: TextStyle = JengaListSheetDefaults.titleStyle, subtitleStyle: TextStyle = JengaListSheetDefaults.subtitleStyle, subtitleColor: Color = JengaListSheetDefaults.subtitleColor, headerPadding: PaddingValues = JengaListSheetDefaults.headerPadding, contentPadding: PaddingValues = JengaListSheetDefaults.contentPadding, footerPadding: PaddingValues = JengaListSheetDefaults.footerPadding, footerSpacing: Dp = JengaListSheetDefaults.footerSpacing, content: LazyListScope.() -> Unit)(source)

A modal bottom sheet with a title, a lazily laid out body, and an optional footer pinned to the bottom, above the keyboard. Use it for pickers and short forms; for free-form content use JengaBottomSheet.

Control visibility by conditional composition, as with JengaBottomSheet.

Parameters

onDismissRequest

called when the sheet is dismissed (drag down or scrim).

title

the heading shown at the top of the sheet.

modifier

the Modifier for the sheet.

sheetState

the sheet state; pass one from rememberJengaSheetState to show or hide the sheet imperatively.

subtitle

optional supporting line under the title.

headerAction

optional slot at the end of the title row (e.g. a close button).

footer

optional row pinned to the bottom of the sheet, for actions.

titleStyle

the title text style.

subtitleStyle

the subtitle text style.

subtitleColor

the subtitle color.

headerPadding

padding around the header.

contentPadding

padding around the lazy body.

footerPadding

padding around the footer row.

footerSpacing

gap between footer children.

content

the sheet body, laid out lazily in a LazyListScope.

Samples

var open by remember {
    mutableStateOf(
        value = true,
    )
}
var selected by remember {
    mutableStateOf(
        value = "Gate A",
    )
}
if (open) {
    JengaListSheet(
        onDismissRequest = { open = false },
        title = "Select a gate",
        subtitle = "Choose which gate you're scanning at.",
        footer = {
            JengaButton(
                text = "Done",
                onClick = { open = false },
                modifier = Modifier.weight(
                    weight = 1f,
                ),
            )
        },
        content = {
            items(
                items = listOf(
                    "Gate A",
                    "Gate B",
                ),
            ) { gate ->
                JengaRadioListItem(
                    headline = gate,
                    selected = gate == selected,
                    onClick = { selected = gate },
                )
            }
        },
    )
}

fun JengaListSheet(onDismissRequest: () -> Unit, title: String, subtitle: AnnotatedString, modifier: Modifier = Modifier, sheetState: JengaSheetState = rememberJengaSheetState(), headerAction: @Composable () -> Unit? = null, footer: @Composable RowScope.() -> Unit? = null, titleStyle: TextStyle = JengaListSheetDefaults.titleStyle, subtitleStyle: TextStyle = JengaListSheetDefaults.subtitleStyle, subtitleColor: Color = JengaListSheetDefaults.subtitleColor, headerPadding: PaddingValues = JengaListSheetDefaults.headerPadding, contentPadding: PaddingValues = JengaListSheetDefaults.contentPadding, footerPadding: PaddingValues = JengaListSheetDefaults.footerPadding, footerSpacing: Dp = JengaListSheetDefaults.footerSpacing, content: LazyListScope.() -> Unit)(source)

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

Parameters

onDismissRequest

called when the sheet is dismissed (drag down or scrim).

title

the heading shown at the top of the sheet.

subtitle

the supporting line under the title, with styled spans.

modifier

the Modifier for the sheet.

sheetState

the sheet state; pass one from rememberJengaSheetState to show or hide the sheet imperatively.

headerAction

optional slot at the end of the title row (e.g. a close button).

footer

optional row pinned to the bottom of the sheet, for actions.

titleStyle

the title text style.

subtitleStyle

the subtitle text style.

subtitleColor

the subtitle color.

headerPadding

padding around the header.

contentPadding

padding around the lazy body.

footerPadding

padding around the footer row.

footerSpacing

gap between footer children.

content

the sheet body, laid out lazily in a LazyListScope.