public object SplitButtonDefaults
Contains default values used by SplitButton and its style variants.
Properties
LeadingIconSize
public val LeadingIconSize: Dp = ButtonSmallTokens.IconSize
Default icon size for the leading button
TrailingIconSize
public val TrailingIconSize: Dp = SplitButtonSmallTokens.TrailingIconSize
Default icon size for the trailing button
Spacing
public val Spacing: Dp = SplitButtonSmallTokens.BetweenSpace
Default spacing between the leading and trailing button
InnerCornerSize
@Deprecated(
message = "Use `SmallInnerCornerSize` instead",
replaceWith = ReplaceWith("SmallInnerCornerSize"),
level = DeprecationLevel.HIDDEN,
)
public val InnerCornerSize: CornerSize = SplitButtonSmallTokens.InnerCornerCornerSize
Default size for the leading button end corners and trailing button start corners
ExtraSmallInnerCornerSize
public val ExtraSmallInnerCornerSize: CornerSize = SplitButtonXSmallTokens.InnerCornerCornerSize
Default extra small size for the leading button end corners and trailing button start corners
SmallInnerCornerSize
public val SmallInnerCornerSize: CornerSize = SplitButtonSmallTokens.InnerCornerCornerSize
Default small size for the leading button end corners and trailing button start corners
MediumInnerCornerSize
public val MediumInnerCornerSize: CornerSize = SplitButtonMediumTokens.InnerCornerCornerSize
Default medium size for the leading button end corners and trailing button start corners
LargeInnerCornerSize
public val LargeInnerCornerSize: CornerSize = SplitButtonLargeTokens.InnerCornerCornerSize
Default large size for the leading button end corners and trailing button start corners
ExtraLargeInnerCornerSize
public val ExtraLargeInnerCornerSize: CornerSize = SplitButtonXLargeTokens.InnerCornerCornerSize
Default extra large size for the leading button end corners and trailing button start corners
ExtraSmallInnerCornerSizePressed
public val ExtraSmallInnerCornerSizePressed: CornerSize =
SplitButtonXSmallTokens.InnerPressedCornerCornerSize
Default extra small size for the leading button end corners and trailing button start corners when pressed
SmallInnerCornerSizePressed
public val SmallInnerCornerSizePressed: CornerSize =
SplitButtonSmallTokens.InnerPressedCornerCornerSize
Default small size for the leading button end corners and trailing button start corners when pressed
MediumInnerCornerSizePressed
public val MediumInnerCornerSizePressed: CornerSize =
SplitButtonMediumTokens.InnerPressedCornerCornerSize
Default medium size for the leading button end corners and trailing button start corners when pressed
LargeInnerCornerSizePressed
public val LargeInnerCornerSizePressed: CornerSize =
SplitButtonLargeTokens.InnerPressedCornerCornerSize
Default large size for the leading button end corners and trailing button start corners when pressed
ExtraLargeInnerCornerSizePressed
public val ExtraLargeInnerCornerSizePressed: CornerSize =
SplitButtonXLargeTokens.InnerPressedCornerCornerSize
Default extra large size for the leading button end corners and trailing button start corners when pressed
OuterCornerSize
public val OuterCornerSize: CornerSize = ShapeDefaults.CornerFull
Default percentage size for the leading button start corners and trailing button end corners
LeadingButtonContentPadding
@Deprecated(
message = "Use `leadingButtonContentPaddingFor(buttonHeight)` instead",
replaceWith = ReplaceWith("leadingButtonContentPaddingFor(buttonHeight)"),
level = DeprecationLevel.HIDDEN,
)
public val LeadingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonSmallTokens.LeadingButtonLeadingSpace,
end = SplitButtonSmallTokens.LeadingButtonTrailingSpace,
)
Default content padding of the leading button
ExtraSmallLeadingButtonContentPadding
public val ExtraSmallLeadingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonXSmallTokens.LeadingButtonLeadingSpace,
end = SplitButtonXSmallTokens.LeadingButtonTrailingSpace,
)
Default content padding of the extra small leading button
SmallLeadingButtonContentPadding
public val SmallLeadingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonSmallTokens.LeadingButtonLeadingSpace,
end = SplitButtonSmallTokens.LeadingButtonTrailingSpace,
)
Default content padding of the small leading button
MediumLeadingButtonContentPadding
public val MediumLeadingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonMediumTokens.LeadingButtonLeadingSpace,
end = SplitButtonMediumTokens.LeadingButtonTrailingSpace,
)
Default content padding of the medium leading button
LargeLeadingButtonContentPadding
public val LargeLeadingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonLargeTokens.LeadingButtonLeadingSpace,
end = SplitButtonLargeTokens.LeadingButtonTrailingSpace,
)
Default content padding of the large leading button
ExtraLargeLeadingButtonContentPadding
public val ExtraLargeLeadingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonXLargeTokens.LeadingButtonLeadingSpace,
end = SplitButtonXLargeTokens.LeadingButtonTrailingSpace,
)
Default content padding of the extra large leading button
ExtraSmallTrailingButtonContentPadding
public val ExtraSmallTrailingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonXSmallTokens.TrailingButtonLeadingSpace,
end = SplitButtonXSmallTokens.TrailingButtonTrailingSpace,
)
Default content padding of the extra small trailing button
SmallTrailingButtonContentPadding
public val SmallTrailingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonSmallTokens.TrailingButtonLeadingSpace,
end = SplitButtonSmallTokens.TrailingButtonTrailingSpace,
)
Default content padding of the small trailing button
MediumTrailingButtonContentPadding
public val MediumTrailingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonMediumTokens.TrailingButtonLeadingSpace,
end = SplitButtonMediumTokens.TrailingButtonTrailingSpace,
)
Default content padding of the medium trailing button
LargeTrailingButtonContentPadding
public val LargeTrailingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonLargeTokens.TrailingButtonLeadingSpace,
end = SplitButtonLargeTokens.TrailingButtonTrailingSpace,
)
Default content padding of the large trailing button
ExtraLargeTrailingButtonContentPadding
public val ExtraLargeTrailingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonXLargeTokens.TrailingButtonLeadingSpace,
end = SplitButtonXLargeTokens.TrailingButtonTrailingSpace,
)
Default content padding of the extra large trailing button
ExtraSmallTrailingButtonIconSize
public val ExtraSmallTrailingButtonIconSize: Dp = SplitButtonXSmallTokens.TrailingIconSize
The default size of the icon used inside of an extra small trailing button of a split button.
SmallTrailingButtonIconSize
public val SmallTrailingButtonIconSize: Dp = SplitButtonSmallTokens.TrailingIconSize
The default size of the icon used inside of a small trailing button of a split button.
MediumTrailingButtonIconSize
public val MediumTrailingButtonIconSize: Dp = SplitButtonMediumTokens.TrailingIconSize
The default size of the icon used inside of a medium trailing button of a split button.
LargeTrailingButtonIconSize
public val LargeTrailingButtonIconSize: Dp = SplitButtonLargeTokens.TrailingIconSize
The default size of the icon used inside of a large trailing button of a split button.
ExtraLargeTrailingButtonIconSize
public val ExtraLargeTrailingButtonIconSize: Dp = SplitButtonXLargeTokens.TrailingIconSize
The default size of the icon used inside of an extra large trailing button of a split button.
TrailingButtonContentPadding
@Deprecated(
message = "Use `SmallTrailingButtonContentPadding` instead",
replaceWith = ReplaceWith("SmallTrailingButtonContentPadding"),
level = DeprecationLevel.HIDDEN,
)
public val TrailingButtonContentPadding: PaddingValues =
PaddingValues(
start = SplitButtonSmallTokens.TrailingButtonLeadingSpace,
end = SplitButtonSmallTokens.TrailingButtonTrailingSpace,
)
Default content padding of the small trailing button
SmallContainerHeight
public val SmallContainerHeight: Dp = SplitButtonSmallTokens.ContainerHeight
Default minimum height of the split button. This applies to both LeadingButton and TrailingButton. Applies to all 4 variants of the split button
ExtraSmallContainerHeight
public val ExtraSmallContainerHeight: Dp = SplitButtonXSmallTokens.ContainerHeight
The default height for an extra small button container.
MediumContainerHeight
public val MediumContainerHeight: Dp = SplitButtonMediumTokens.ContainerHeight
The default height for a medium button container.
LargeContainerHeight
public val LargeContainerHeight: Dp = SplitButtonLargeTokens.ContainerHeight
The default height for a large button container.
ExtraLargeContainerHeight
public val ExtraLargeContainerHeight: Dp = SplitButtonXLargeTokens.ContainerHeight
The default height for an extra large button container.
Functions
leadingButtonShapes
@Deprecated(
message = "This function will be private in the future",
replaceWith = ReplaceWith("leadingButtonShapesFor(buttonHeight)"),
level = DeprecationLevel.HIDDEN,
)
public fun leadingButtonShapes(
endCornerSize: CornerSize = SmallInnerCornerSize
): SplitButtonShapes
Default shapes for the leading button. This defines the shapes the leading button should morph to when enabled, pressed etc.
Parameters
| endCornerSize | the size for top end corner and bottom end corner |
trailingButtonShapes
@Deprecated(
message = "This function will be private in the future",
replaceWith = ReplaceWith("trailingButtonShapesFor(buttonHeight)"),
level = DeprecationLevel.HIDDEN,
)
public fun trailingButtonShapes(
startCornerSize: CornerSize = SmallInnerCornerSize
): SplitButtonShapes
Default shapes for the trailing button
Parameters
| startCornerSize | the size for top start corner and bottom start corner |
leadingButtonShapesFor
@Composable
public fun leadingButtonShapesFor(buttonHeight: Dp): SplitButtonShapes
Recommended leading button SplitButtonShapes for a provided leading button height.
Parameters
| buttonHeight | The height of the button |
trailingButtonShapesFor
@Composable
public fun trailingButtonShapesFor(buttonHeight: Dp): SplitButtonShapes
Recommended trailing button SplitButtonShapes for a provided trailing button height.
Parameters
| buttonHeight | The height of the button |
leadingButtonContentPaddingFor
public fun leadingButtonContentPaddingFor(buttonHeight: Dp): PaddingValues
Recommended PaddingValues for a provided leading button height.
Parameters
| buttonHeight | The height of the button |
trailingButtonContentPaddingFor
public fun trailingButtonContentPaddingFor(buttonHeight: Dp): PaddingValues
Recommended PaddingValues for a provided trailing button height.
Parameters
| buttonHeight | The height of the button |
leadingButtonIconSizeFor
public fun leadingButtonIconSizeFor(buttonHeight: Dp): Dp
Recommended leading button Icon size for a provided button height.
Parameters
| buttonHeight | The height of the button |
trailingButtonIconSizeFor
public fun trailingButtonIconSizeFor(buttonHeight: Dp): Dp
Recommended trailing button Icon size for a provided button height.
Parameters
| buttonHeight | The height of the button |
LeadingButton
@Composable
public 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.
The default text style for internal Text components will be set to Typography.labelLarge.
Parameters
| onClick | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content for the button. |
TrailingButton
@Composable
public 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.
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 | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content to be placed in the button |
TrailingButton
@Composable
public 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.
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 | indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state. |
| onCheckedChange | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content to be placed in the button |
TonalLeadingButton
@Composable
public 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.
The default text style for internal Text components will be set to Typography.labelLarge.
Parameters
| onClick | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content for the button. |
TonalTrailingButton
@Composable
public 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.
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 | indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state. |
| onCheckedChange | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content to be placed in the button |
OutlinedLeadingButton
@Composable
public 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 an elevated leading button that has the same visual as an 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 | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content for the button. |
OutlinedTrailingButton
@Composable
public 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 an outlined trailing button that has the same visual as an 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 | indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state. |
| onCheckedChange | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content to be placed in the button |
ElevatedLeadingButton
@Composable
public 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 an elevated leading button that has the same visual as an 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 | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content for the button. |
ElevatedTrailingButton
@Composable
public 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 an elevated trailing button that has the same visual as an 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 | indicates whether the button is checked. This will trigger the corner morphing animation to reflect the updated state. |
| onCheckedChange | called when the button is clicked |
| modifier | the Modifier to be applied to this button. |
| enabled | 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 | the SplitButtonShapes that the trailing button will morph between depending on the user's interaction with the button. |
| colors | ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.buttonColors. |
| elevation | 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 | the border to draw around the container of this button |
| contentPadding | the spacing values to apply internally between the container and the content |
| interactionSource | 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 | the content to be placed in the button |