SplitButtonDefaults

Contains default values used by SplitButtonLayout and its style variants.

Properties

Link copied to clipboard

The default height for an extra large button container.

Link copied to clipboard

Default extra large size for the leading button end corners and trailing button start corners

Link copied to clipboard

Default extra large size for the leading button end corners and trailing button start corners when pressed

Link copied to clipboard

Default content padding of the extra large leading button

Link copied to clipboard

Default content padding of the extra large trailing button

Link copied to clipboard

The default size of the icon used inside of an extra large trailing button of a split button.

Link copied to clipboard

The default height for an extra small button container.

Link copied to clipboard

Default extra small size for the leading button end corners and trailing button start corners

Link copied to clipboard

Default extra small size for the leading button end corners and trailing button start corners when pressed

Link copied to clipboard

Default content padding of the extra small leading button

Link copied to clipboard

Default content padding of the extra small trailing button

Link copied to clipboard

The default size of the icon used inside of an extra small trailing button of a split button.

Link copied to clipboard

The default height for a large button container.

Link copied to clipboard
val LargeInnerCornerSize: CornerSize

Default large size for the leading button end corners and trailing button start corners

Link copied to clipboard

Default large size for the leading button end corners and trailing button start corners when pressed

Link copied to clipboard

Default content padding of the large leading button

Link copied to clipboard

Default content padding of the large trailing button

Link copied to clipboard

The default size of the icon used inside of an large trailing button of a split button.

Link copied to clipboard

Default icon size for the leading button

Link copied to clipboard

The default height for a medium button container.

Link copied to clipboard
val MediumInnerCornerSize: CornerSize

Default medium size for the leading button end corners and trailing button start corners

Link copied to clipboard

Default medium size for the leading button end corners and trailing button start corners when pressed

Link copied to clipboard

Default content padding of the medium leading button

Link copied to clipboard

Default content padding of the medium trailing button

Link copied to clipboard

The default size of the icon used inside of an medium trailing button of a split button.

Link copied to clipboard
val OuterCornerSize: CornerSize

Default percentage size for the leading button start corners and trailing button end corners

Link copied to clipboard

Default minimum height of the split button. This applies to both LeadingButton and TrailingButton. Applies to all 4 variants of the split button

Link copied to clipboard
val SmallInnerCornerSize: CornerSize

Default small size for the leading button end corners and trailing button start corners

Link copied to clipboard

Default small size for the leading button end corners and trailing button start corners when pressed

Link copied to clipboard

Default content padding of the small leading button

Link copied to clipboard

Default content padding of the small trailing button

Link copied to clipboard

The default size of the icon used inside of an small trailing button of a split button.

Link copied to clipboard
val Spacing: Dp

Default spacing between the leading and trailing button

Link copied to clipboard

Default icon size for the trailing button

Functions

Link copied to clipboard
@Composable
fun ElevatedLeadingButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = leadingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.elevatedButtonColors(), elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = leadingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Create a elevated leading button that has the same visual as a ElevatedButton. To create a filled, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

Link copied to clipboard
@Composable
fun ElevatedTrailingButton(checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = trailingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.elevatedButtonColors(), elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = trailingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Creates a elevated trailing button that has the same visual as a ElevatedButton. When checked is updated from false to true, the buttons corners will morph to full by default. Pressed shape and checked shape can be customized via shapes param.

Link copied to clipboard
@Composable
fun LeadingButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = leadingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.buttonColors(), elevation: ButtonElevation? = ButtonDefaults.buttonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = leadingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Create a default leading button that has the same visual as a FilledButton. To create a tonal, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

Link copied to clipboard
fun leadingButtonContentPaddingFor(buttonHeight: Dp): PaddingValues

Recommended PaddingValues for a provided leading button height.

Link copied to clipboard
fun leadingButtonIconSizeFor(buttonHeight: Dp): Dp

Recommended leading button Icon size for a provided button height.

Link copied to clipboard
@Composable
fun leadingButtonShapesFor(buttonHeight: Dp): SplitButtonShapes

Recommended leading button SplitButtonShapes for a provided leading button height.

Link copied to clipboard
@Composable
fun OutlinedLeadingButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = leadingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.outlinedButtonColors(), elevation: ButtonElevation? = null, border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled), contentPadding: PaddingValues = leadingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Create a elevated leading button that has the same visual as a ElevatedButton. To create a filled, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

Link copied to clipboard
@Composable
fun OutlinedTrailingButton(checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = trailingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.outlinedButtonColors(), elevation: ButtonElevation? = null, border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled), contentPadding: PaddingValues = trailingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Creates a outlined trailing button that has the same visual as a OutlinedButton. When checked is updated from false to true, the buttons corners will morph to full by default. Pressed shape and checked shape can be customized via shapes param.

Link copied to clipboard
@Composable
fun TonalLeadingButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = leadingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(), elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = leadingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Create a tonal leading button that has the same visual as a TonalButton. To create a filled, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

Link copied to clipboard
@Composable
fun TonalTrailingButton(checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = trailingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(), elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = trailingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Creates a tonal trailing button that has the same visual as a FilledTonalButton. When checked is updated from false to true, the buttons corners will morph to full by default. Pressed shape and checked shape can be customized via shapes param.

Link copied to clipboard
@Composable
fun TrailingButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = trailingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.buttonColors(), elevation: ButtonElevation? = ButtonDefaults.buttonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = trailingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Creates a trailing button that has the same visual as a Button.

@Composable
fun TrailingButton(checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shapes: SplitButtonShapes = trailingButtonShapesFor(SmallContainerHeight), colors: ButtonColors = ButtonDefaults.buttonColors(), elevation: ButtonElevation? = ButtonDefaults.buttonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = trailingButtonContentPaddingFor(SmallContainerHeight), interactionSource: MutableInteractionSource? = null, content: @Composable RowScope.() -> Unit)

Creates a trailing button that has the same visual as a Button. When checked is updated from false to true, the buttons corners will morph to full by default. Pressed shape and checked shape can be customized via shapes param.

Link copied to clipboard
fun trailingButtonContentPaddingFor(buttonHeight: Dp): PaddingValues

Recommended PaddingValues for a provided trailing button height.

Link copied to clipboard
fun trailingButtonIconSizeFor(buttonHeight: Dp): Dp

Recommended trailing button Icon size for a provided button height.

Link copied to clipboard
@Composable
fun trailingButtonShapesFor(buttonHeight: Dp): SplitButtonShapes

Recommended trailing button SplitButtonShapes for a provided trailing button height.