public object IconToggleButtonDefaults
Contains default values used by IconToggleButtons.
Properties
contentPadding
@get:Composable
public val contentPadding: PaddingValues
Default content padding used for an IconToggleButton.
Functions
shape
@Composable
public fun shape(
checked: Boolean,
checkedShape: Shape = ToggleButtonDefaults.CheckedShape,
uncheckedShape: Shape = GlimmerTheme.shapes.large,
): Shape
Chooses a Shape based on the checked state and can be used to override the default Glimmer button shapes. Note that it simply switches shapes without animation.
If you require an animated version, please refer to IconToggleButtonDefaults.animateShape, which uses default Glimmer animations and shapes, or consider creating a custom animated shape.
Parameters
| checked | whether the button is in the checked state |
| checkedShape | the shape of the button when it is checked |
| uncheckedShape | the shape of the button when it is unchecked |
animateShape
@Composable
public fun animateShape(checked: Boolean): Shape
Provides a Shape that uses the default Glimmer shapes for buttons and animates transitions between states. If you require an animated transition between your own custom shapes, please consider creating a custom animated shape.
Parameters
| checked | whether the button is in the checked state |
colors
@Composable
public fun colors(
backgroundColor: Color = GlimmerTheme.colors.surface,
checkedBackgroundColor: Color = GlimmerTheme.colors.outline,
contentColor: Color = calculateContentColor(backgroundColor),
checkedContentColor: Color = calculateContentColor(checkedBackgroundColor),
): IconToggleButtonColors
Creates IconToggleButtonColors with default values for an IconToggleButton.
Parameters
| backgroundColor | The background color when the button is unchecked. |
| checkedBackgroundColor | The background color when the button is checked. |
| contentColor | The content color when the button is unchecked. |
| checkedContentColor | The content color when the button is checked. |