SplitButtonDefaults


Contains default values used by SplitButtonLayout and its style variants.

Summary

Public functions

Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
ElevatedLeadingButton(
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Create a elevated leading button that has the same visual as a ElevatedButton.

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
ElevatedTrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Creates a elevated trailing button that has the same visual as a ElevatedButton.

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
LeadingButton(
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Create a default leading button that has the same visual as a FilledButton.

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
OutlinedLeadingButton(
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Create a elevated leading button that has the same visual as a ElevatedButton.

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
OutlinedTrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Creates a outlined trailing button that has the same visual as a OutlinedButton.

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
TonalLeadingButton(
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Create a tonal leading button that has the same visual as a TonalButton.

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
TonalTrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Creates a tonal trailing button that has the same visual as a FilledTonalButton.

Cmn
Unit
@Composable
@ExperimentalMaterial3ExpressiveApi
TrailingButton(
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

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

Cmn
Unit
@Composable
@ExperimentalMaterial3ExpressiveApi
TrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    shapes: SplitButtonShapes,
    colors: ButtonColors,
    elevation: ButtonElevation?,
    border: BorderStroke?,
    contentPadding: PaddingValues,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

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

Cmn
SplitButtonShapes

Default shapes for the leading button.

Cmn
SplitButtonShapes
trailingButtonShapes(startCornerSize: CornerSize)

Default shapes for the trailing button

Cmn

Public properties

CornerSize

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

Cmn
PaddingValues

Default content padding of the leading button

Cmn
Dp

Default icon size for the leading button

Cmn
CornerSize

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

Cmn
Dp

Default spacing between the leading and trailing button

Cmn
PaddingValues

Default content padding of the trailing button

Cmn
Dp

Default icon size for the trailing button

Cmn

Public functions

ElevatedLeadingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun ElevatedLeadingButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = leadingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),
    elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(),
    border: BorderStroke? = null,
    contentPadding: PaddingValues = LeadingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
onClick: () -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = leadingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.elevatedButtonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = LeadingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content for the button.

ElevatedTrailingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun ElevatedTrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = trailingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),
    elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(),
    border: BorderStroke? = null,
    contentPadding: PaddingValues = TrailingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

To create a tonal, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
checked: Boolean

indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state.

onCheckedChange: (Boolean) -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = trailingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.elevatedButtonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = TrailingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content to be placed in the button

LeadingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun LeadingButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = leadingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.buttonColors(),
    elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
    border: BorderStroke? = null,
    contentPadding: PaddingValues = LeadingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
onClick: () -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = leadingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.buttonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.buttonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = LeadingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content for the button.

OutlinedLeadingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun OutlinedLeadingButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = leadingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.outlinedButtonColors(),
    elevation: ButtonElevation? = null,
    border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled),
    contentPadding: PaddingValues = LeadingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
onClick: () -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = leadingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.outlinedButtonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = null

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled)

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = LeadingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content for the button.

OutlinedTrailingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun OutlinedTrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = trailingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.outlinedButtonColors(),
    elevation: ButtonElevation? = null,
    border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled),
    contentPadding: PaddingValues = TrailingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

To create a tonal, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
checked: Boolean

indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state.

onCheckedChange: (Boolean) -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = trailingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.outlinedButtonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = null

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled)

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = TrailingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content to be placed in the button

TonalLeadingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun TonalLeadingButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = leadingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(),
    elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(),
    border: BorderStroke? = null,
    contentPadding: PaddingValues = LeadingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
onClick: () -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = leadingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.filledTonalButtonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = LeadingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content for the button.

TonalTrailingButton

@ExperimentalMaterial3ExpressiveApi
@Composable
fun TonalTrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = trailingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(),
    elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(),
    border: BorderStroke? = null,
    contentPadding: PaddingValues = TrailingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

To create a tonal, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
checked: Boolean

indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state.

onCheckedChange: (Boolean) -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = trailingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.filledTonalButtonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = TrailingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content to be placed in the button

TrailingButton

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

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

To create a tonal, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
onClick: () -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = trailingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.buttonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.buttonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = TrailingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content to be placed in the button

TrailingButton

@Composable
@ExperimentalMaterial3ExpressiveApi
fun TrailingButton(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shapes: SplitButtonShapes = trailingButtonShapes(),
    colors: ButtonColors = ButtonDefaults.buttonColors(),
    elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
    border: BorderStroke? = null,
    contentPadding: PaddingValues = TrailingButtonContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): 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.

To create a tonal, outlined, or elevated version, the default value of Button params can be passed in. For example, ElevatedButton.

The default text style for internal Text components will be set to Typography.labelLarge.

Parameters
checked: Boolean

indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state.

onCheckedChange: (Boolean) -> Unit

called when the button is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this button.

enabled: Boolean = true

controls the enabled state of the split button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shapes: SplitButtonShapes = trailingButtonShapes()

the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button.

colors: ButtonColors = ButtonDefaults.buttonColors()

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors.

elevation: ButtonElevation? = ButtonDefaults.buttonElevation()

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. See ButtonElevation.shadowElevation.

border: BorderStroke? = null

the border to draw around the container of this button contentPadding the spacing values to apply internally between the container and the content

contentPadding: PaddingValues = TrailingButtonContentPadding

the spacing values to apply internally between the container and the content

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

the content to be placed in the button

leadingButtonShapes

fun leadingButtonShapes(endCornerSize: CornerSize = InnerCornerSize): SplitButtonShapes

Default shapes for the leading button. This defines the shapes the leading button should morph to when enabled, pressed etc.

Parameters
endCornerSize: CornerSize = InnerCornerSize

the size for top end corner and bottom end corner

trailingButtonShapes

fun trailingButtonShapes(startCornerSize: CornerSize = InnerCornerSize): SplitButtonShapes

Default shapes for the trailing button

Parameters
startCornerSize: CornerSize = InnerCornerSize

the size for top start corner and bottom start corner

Public properties

InnerCornerSize

val InnerCornerSizeCornerSize

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

LeadingButtonContentPadding

val LeadingButtonContentPaddingPaddingValues

Default content padding of the leading button

LeadingIconSize

val LeadingIconSizeDp

Default icon size for the leading button

OuterCornerSize

val OuterCornerSizeCornerSize

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

Spacing

val SpacingDp

Default spacing between the leading and trailing button

TrailingButtonContentPadding

val TrailingButtonContentPaddingPaddingValues

Default content padding of the trailing button

TrailingIconSize

val TrailingIconSizeDp

Default icon size for the trailing button