Package-level declarations

JengaDropdownMenu with JengaDropdownMenuItem and JengaDropdownMenuDivider.

Types

Link copied to clipboard

Defaults and token mappings for JengaDropdownMenu and JengaDropdownMenuItem. The composable members follow the theme's JengaDropdownMenuStyle; the constants are Jenga's built-in values, and the components resolve the theme's values over them.

Link copied to clipboard
class JengaDropdownMenuItemColors(val content: Color, val supporting: Color, val dangerContent: Color, val disabledContent: Color, val disabledSupporting: Color)

Resolved colors for a JengaDropdownMenuItem. Override via JengaDropdownMenuDefaults.itemColors.

Link copied to clipboard
class JengaDropdownMenuStyle(val shape: Shape? = null, val width: Dp? = null, val border: BorderStroke? = null, val shadowElevation: Dp? = null, val itemTextStyle: TextStyle? = null, val itemMinHeight: Dp? = null, val itemContentPadding: PaddingValues? = null, val itemColors: JengaDropdownMenuItemColors? = null)

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

Functions

Link copied to clipboard
fun JengaDropdownMenu(expanded: Boolean, onDismissRequest: () -> Unit, modifier: Modifier = Modifier, offset: DpOffset = DpOffset(0.dp, 0.dp), shape: Shape = JengaDropdownMenuDefaults.shape, border: BorderStroke? = JengaTheme.components.dropdownMenu?.border ?: JengaDropdownMenuDefaults.border, shadowElevation: Dp = JengaTheme.components.dropdownMenu?.shadowElevation ?: JengaDropdownMenuDefaults.ShadowElevation, width: Dp = JengaTheme.components.dropdownMenu?.width ?: JengaDropdownMenuDefaults.Width, content: @Composable ColumnScope.() -> Unit)

A dropdown menu anchored to its caller, themed with Jenga tokens. Place JengaDropdownMenuItems in content. Control visibility via expanded.

Link copied to clipboard
fun JengaDropdownMenuDivider(modifier: Modifier = Modifier, contentPadding: PaddingValues = JengaDropdownMenuDefaults.dividerPadding)

A thin divider between groups of JengaDropdownMenuItems.

Link copied to clipboard
fun JengaDropdownMenuItem(text: String, onClick: () -> Unit, modifier: Modifier = Modifier, leadingIcon: @Composable () -> Unit? = null, enabled: Boolean = true, supportingText: String? = null, tone: JengaDropdownMenuItemTone = JengaDropdownMenuItemTone.Default, textStyle: TextStyle = JengaDropdownMenuDefaults.itemTextStyle, minHeight: Dp = JengaTheme.components.dropdownMenu?.itemMinHeight ?: JengaDropdownMenuDefaults.ItemMinHeight, contentPadding: PaddingValues = JengaDropdownMenuDefaults.itemContentPadding, colors: JengaDropdownMenuItemColors = JengaDropdownMenuDefaults.itemColors())

A single item in a JengaDropdownMenu. A disabled item stays visible and can explain itself through supportingText (e.g. why the action is unavailable).