JengaBottomSheet

fun JengaBottomSheet(onDismissRequest: () -> Unit, modifier: Modifier = Modifier, content: @Composable ColumnScope.() -> Unit)(source)

A modal bottom sheet, themed with Jenga tokens.

Control visibility by conditional composition: render this only while the sheet should be shown:

if (showSheet) {
JengaBottomSheet(
onDismissRequest = { showSheet = false },
content = { /* content */},
)
}

For imperative control (e.g. animating the sheet closed in response to a ViewModel effect before navigating), use the overload that takes a JengaSheetState from rememberJengaSheetState.

Parameters

onDismissRequest

called after the sheet has closed (drag down, scrim or Back).

modifier

the Modifier for the sheet.

content

the sheet body, laid out in a ColumnScope.

Samples

var open by remember {
    mutableStateOf(
        value = true,
    )
}
if (open) {
    JengaBottomSheet(
        onDismissRequest = { open = false },
        content = {
            JengaText(
                text = "Select a gate",
            )
        },
    )
}

fun JengaBottomSheet(onDismissRequest: () -> Unit, sheetState: JengaSheetState, modifier: Modifier = Modifier, gesturesEnabled: Boolean = true, content: @Composable ColumnScope.() -> Unit)(source)

A modal bottom sheet whose visibility is driven by an external sheetState, so it can be shown/hidden imperatively (the MVI pattern: a ViewModel effect calls sheetState.hide(), then composition removes the sheet).

Parameters

onDismissRequest

called after the sheet has closed (drag down, scrim or Back). Not called when the state's confirmDismiss keeps it open.

sheetState

the externally-owned state from rememberJengaSheetState.

modifier

the Modifier for the sheet.

gesturesEnabled

whether the sheet can be dragged. When false, the drag handle stays visible, the sheet stays put, and gestures inside the content (a drawing pad, a list) still work.

content

the sheet body, laid out in a ColumnScope.