JengaSideSheet

fun JengaSideSheet(onDismissRequest: () -> Unit, title: String, modifier: Modifier = Modifier, subtitle: String? = null, headerAction: @Composable () -> Unit? = null, footer: @Composable RowScope.() -> Unit? = null, width: Dp = JengaSideSheetDefaults.Width, shape: Shape = JengaSideSheetDefaults.shape, titleStyle: TextStyle = JengaListSheetDefaults.titleStyle, subtitleStyle: TextStyle = JengaListSheetDefaults.subtitleStyle, headerPadding: PaddingValues = JengaSideSheetDefaults.headerPadding, contentPadding: PaddingValues = JengaListSheetDefaults.contentPadding, footerPadding: PaddingValues = JengaListSheetDefaults.footerPadding, footerSpacing: Dp = JengaListSheetDefaults.footerSpacing, content: LazyListScope.() -> Unit)(source)

A modal sheet that slides in from the end edge over a scrim, with the same layout as JengaListSheet: a title, a lazily laid out body, and an optional footer pinned to the bottom. Use it in place of a bottom sheet on wide or landscape layouts.

Control visibility by conditional composition. Tapping the scrim or pressing back calls onDismissRequest.

Parameters

onDismissRequest

called when the sheet should close.

title

the heading shown at the top of the sheet.

modifier

the Modifier for the full-window container holding the scrim and sheet.

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.

width

the sheet width.

shape

the sheet shape.

titleStyle

the title text style.

subtitleStyle

the subtitle text style.

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,
    )
}
if (open) {
    JengaSideSheet(
        onDismissRequest = { open = false },
        title = "Filters",
        footer = {
            JengaButton(
                text = "Apply",
                onClick = { open = false },
                modifier = Modifier.weight(
                    weight = 1f,
                ),
            )
        },
        content = {
            item {
                JengaCheckboxListItem(
                    headline = "Open only",
                    checked = true,
                    onCheckedChange = {},
                )
            }
        },
    )
}

fun JengaSideSheet(onDismissRequest: () -> Unit, title: String, subtitle: AnnotatedString, modifier: Modifier = Modifier, headerAction: @Composable () -> Unit? = null, footer: @Composable RowScope.() -> Unit? = null, width: Dp = JengaSideSheetDefaults.Width, shape: Shape = JengaSideSheetDefaults.shape, titleStyle: TextStyle = JengaListSheetDefaults.titleStyle, subtitleStyle: TextStyle = JengaListSheetDefaults.subtitleStyle, headerPadding: PaddingValues = JengaSideSheetDefaults.headerPadding, contentPadding: PaddingValues = JengaListSheetDefaults.contentPadding, footerPadding: PaddingValues = JengaListSheetDefaults.footerPadding, footerSpacing: Dp = JengaListSheetDefaults.footerSpacing, content: LazyListScope.() -> Unit)(source)

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

Parameters

onDismissRequest

called when the sheet should close.

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 full-window container holding the scrim and sheet.

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.

width

the sheet width.

shape

the sheet shape.

titleStyle

the title text style.

subtitleStyle

the subtitle text style.

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.