Package-level declarations

Overlays: JengaDialog, JengaBottomSheet (with rememberJengaSheetState, which can refuse a close), JengaListSheet, JengaSideSheet, and snackbars (JengaSnackbar, JengaSnackbarHost).

Types

Link copied to clipboard
class JengaDialogColors(val container: Color, val title: Color, val text: Color)

Resolved colors for a JengaDialog. Override via JengaDialogDefaults.colors.

Link copied to clipboard

Defaults for JengaDialog. Each one follows the theme's JengaDialogStyle.

Link copied to clipboard
class JengaDialogStyle(val shape: Shape? = null, val contentPadding: PaddingValues? = null, val titleStyle: TextStyle? = null, val textStyle: TextStyle? = null, val actionSpacing: Dp? = null, val colors: JengaDialogColors? = null)

Theme-wide style for every JengaDialog, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.dialog. A null value keeps Jenga's default; arguments passed to a JengaDialog call still win.

Link copied to clipboard

Defaults for JengaListSheet and JengaSideSheet. Each one follows the theme's JengaListSheetStyle.

Link copied to clipboard
class JengaListSheetStyle(val titleStyle: TextStyle? = null, val subtitleStyle: TextStyle? = null, val subtitleColor: Color? = null, val headerPadding: PaddingValues? = null, val contentPadding: PaddingValues? = null, val footerPadding: PaddingValues? = null, val footerSpacing: Dp? = null)

Theme-wide style for every JengaListSheet and JengaSideSheet, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.listSheet. A null value keeps Jenga's default; arguments passed to a call still win.

Link copied to clipboard

The visibility state of a JengaBottomSheet. Create one with rememberJengaSheetState and drive it imperatively (e.g. from an MVI effect): scope.launch { sheetState.hide() }. Keeps the underlying Material state out of Jenga's public API.

Link copied to clipboard
Link copied to clipboard
class JengaSnackbarColors(val container: Color, val content: Color, val action: Color = content)

Resolved colors for a JengaSnackbar. Override via JengaSnackbarDefaults.colors.

Link copied to clipboard

Defaults and token mappings for JengaSnackbar.

Link copied to clipboard

How long a snackbar stays before it auto-dismisses.

Link copied to clipboard

Drives a JengaSnackbarHost: enqueue transient messages with showSnackbar. Create one with rememberJengaSnackbarHostState. Wraps the Material queueing machinery, keeping it out of Jenga's public API.

Link copied to clipboard
Link copied to clipboard
class JengaSnackbarStyle(val shape: Shape? = null, val contentPadding: PaddingValues? = null, val hostPadding: PaddingValues? = null, val messageStyle: TextStyle? = null, val actionStyle: TextStyle? = null, val colors: JengaSnackbarColors? = null)

Theme-wide style for every JengaSnackbar, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.snackbar. A null value keeps Jenga's default; arguments passed to a call still win.

Link copied to clipboard

Functions

Link copied to clipboard
fun JengaBottomSheet(onDismissRequest: () -> Unit, modifier: Modifier = Modifier, content: @Composable ColumnScope.() -> Unit)

A modal bottom sheet, themed with Jenga tokens.

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

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).

Link copied to clipboard
fun JengaDialog(onDismissRequest: () -> Unit, confirmButton: @Composable () -> Unit, modifier: Modifier = Modifier, title: String? = null, text: String? = null, dismissButton: @Composable () -> Unit? = null, shape: Shape = JengaDialogDefaults.shape, contentPadding: PaddingValues = JengaDialogDefaults.contentPadding, titleStyle: TextStyle = JengaDialogDefaults.titleStyle, textStyle: TextStyle = JengaDialogDefaults.textStyle, actionSpacing: Dp = JengaDialogDefaults.actionSpacing, colors: JengaDialogColors = JengaDialogDefaults.colors(), border: BorderStroke? = JengaDialogDefaults.border)

A modal dialog with an optional title and body, plus confirm/dismiss actions. For a destructive confirmation, pass a danger JengaButton as confirmButton.

Link copied to clipboard
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)

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.

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)

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

Link copied to clipboard
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)

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.

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)

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

Link copied to clipboard
fun JengaSnackbar(message: String, modifier: Modifier = Modifier, tone: JengaSnackbarTone = JengaSnackbarTone.Neutral, actionLabel: String? = null, onAction: () -> Unit? = null, shape: Shape = JengaSnackbarDefaults.shape, colors: JengaSnackbarColors = JengaSnackbarDefaults.colors(), contentPadding: PaddingValues = JengaSnackbarDefaults.contentPadding, messageStyle: TextStyle = JengaSnackbarDefaults.messageStyle, actionStyle: TextStyle = JengaSnackbarDefaults.actionStyle)

A transient message surface with an optional action.

Link copied to clipboard
fun JengaSnackbarHost(hostState: JengaSnackbarHostState, modifier: Modifier = Modifier, snackbarPadding: PaddingValues = JengaSnackbarDefaults.hostPadding, shape: Shape = JengaSnackbarDefaults.shape, colors: JengaSnackbarColors = JengaSnackbarDefaults.colors(), contentPadding: PaddingValues = JengaSnackbarDefaults.contentPadding, messageStyle: TextStyle = JengaSnackbarDefaults.messageStyle, actionStyle: TextStyle = JengaSnackbarDefaults.actionStyle)

Renders the snackbar queued on hostState as a JengaSnackbar. Place it in a scaffold's snackbarHost slot (see JengaScaffold).

Link copied to clipboard
fun rememberJengaSheetState(skipPartiallyExpanded: Boolean = true, confirmDismiss: () -> Boolean? = null): JengaSheetState

Remembers a JengaSheetState for an externally-controlled JengaBottomSheet.