ElevatedToggleButton
Source set: Common
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun ElevatedToggleButton(
checked: Boolean,
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
shapes: ToggleButtonShapes = ToggleButtonDefaults.shapesFor(ToggleButtonDefaults.MinHeight),
colors: ToggleButtonColors = ElevatedToggleButtonDefaults.colors(),
elevation: ToggleButtonElevation? = ElevatedToggleButtonDefaults.elevation(),
border: BorderStroke? = null,
contentPadding: PaddingValues =
ToggleButtonDefaults.contentPaddingFor(ToggleButtonDefaults.MinHeight),
interactionSource: MutableInteractionSource? = null,
content: @Composable RowScope.() -> Unit,
)
Parameters
| checked | whether the toggle button is toggled on or off. |
| onCheckedChange | called when the toggle button is clicked. |
| modifier | the Modifier to be applied to the toggle button. |
| enabled | controls the enabled state of this toggle button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| shapes | the ToggleButtonShapes that the toggle button will morph between depending on the user's interaction with the toggle button. |
| colors | ToggleButtonColors that will be used to resolve the colors used for this toggle button in different states. See ElevatedToggleButtonDefaults.colors. |
| elevation | ToggleButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. Additionally, when the container color is ColorScheme.surface, this controls the amount of primary color applied as an overlay. See ElevatedToggleButtonDefaults.elevation. |
| border | the border to draw around the container of this toggle 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 toggle button. You can use this to change the toggle button's appearance or preview the toggle button in different states. Note that if null is provided, interactions will still happen internally. |
| content | The content displayed on the toggle button, expected to be text, icon or image. |
ElevatedToggleButton
Source set: Common
@Composable
public fun ElevatedToggleButton(
checked: Boolean,
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
buttonSize: ToggleButtonSize = ToggleButtonSize.Small,
enabled: Boolean = true,
icon: @Composable (() -> Unit)? = null,
shapes: ToggleButtonShapes = ToggleButtonDefaults.shapesFor(buttonSize),
colors: ToggleButtonColors = ElevatedToggleButtonDefaults.colors(),
elevation: ToggleButtonElevation? = ElevatedToggleButtonDefaults.elevation(),
border: BorderStroke? = null,
contentPadding: PaddingValues =
ToggleButtonDefaults.contentPaddingFor(buttonSize, hasStartIcon = icon != null),
interactionSource: MutableInteractionSource? = null,
content: @Composable RowScope.() -> Unit,
)
Parameters
| checked | whether the toggle button is toggled on or off. |
| onCheckedChange | called when the toggle button is clicked. |
| modifier | the Modifier to be applied to the toggle button. |
| buttonSize | the ToggleButtonSize of this toggle button. |
| enabled | controls the enabled state of this toggle button. |
| icon | optional icon to be placed before the content. |
| shapes | the ToggleButtonShapes used for this toggle button. |
| colors | ToggleButtonColors used for this toggle button. See ElevatedToggleButtonDefaults.colors. |
| elevation | ToggleButtonElevation used for this button. See ElevatedToggleButtonDefaults.elevation. |
| border | the border to draw around the container. |
| contentPadding | the spacing values to apply internally. |
| interactionSource | an optional hoisted MutableInteractionSource. |
| content | The content displayed on the toggle button. |
