Object

InputChipDefaults

Contains the baseline values used by an InputChip.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
object InputChipDefaults

Contains the baseline values used by an InputChip.

Properties

Common
val Height = InputChipTokens.ContainerHeight

The height applied for an input chip. Note that you can override it by applying Modifier.height directly on a chip.

Common
val IconSize = InputChipTokens.LeadingIconSize

The size of an input chip icon.

Common
val AvatarSize = InputChipTokens.AvatarSize

The size of an input chip avatar.

Common
val HorizontalSpacing = 8.dp

Default spacing between elements in an input chip.

Common
val shape: Shape

Default shape of an input chip.

Functions

horizontalArrangement

fun horizontalArrangement(): Arrangement.Horizontal

Returns the default arrangement of the icons/avatar and label within an input chip.


horizontalArrangement

fun horizontalArrangement(spacing: Dp): Arrangement.Horizontal

Creates an Arrangement.Horizontal that represents the default arrangement of the icons/avatar and label within an input chip.

Parameters

spacing the spacing between the icon and label

contentPadding

fun contentPadding(
        hasAvatar: Boolean,
        hasLeadingIcon: Boolean,
        hasTrailingIcon: Boolean,
    ): PaddingValues

Returns the padding around the content of this chip, including the leadingIcon/avatar, label, and trailingIcon.

@Composable fun inputChipColors() = MaterialTheme.colorScheme.defaultInputChipColors

Creates a SelectableChipColors that represents the default container, label, and icon colors used in an InputChip.


inputChipColors

@Composable
    fun inputChipColors(
        containerColor: Color = Color.Unspecified,
        labelColor: Color = Color.Unspecified,
        leadingIconColor: Color = Color.Unspecified,
        trailingIconColor: Color = Color.Unspecified,
        disabledContainerColor: Color = Color.Unspecified,
        disabledLabelColor: Color = Color.Unspecified,
        disabledLeadingIconColor: Color = Color.Unspecified,
        disabledTrailingIconColor: Color = Color.Unspecified,
        selectedContainerColor: Color = Color.Unspecified,
        disabledSelectedContainerColor: Color = Color.Unspecified,
        selectedLabelColor: Color = Color.Unspecified,
        selectedLeadingIconColor: Color = Color.Unspecified,
        selectedTrailingIconColor: Color = Color.Unspecified,
    ): SelectableChipColors

Creates a SelectableChipColors that represents the default container, label, and icon colors used in an InputChip.

Parameters

containerColor the container color of this chip when enabled
labelColor the label color of this chip when enabled
leadingIconColor the color of this chip's start icon when enabled
trailingIconColor the color of this chip's start end icon when enabled
disabledContainerColor the container color of this chip when not enabled
disabledLabelColor the label color of this chip when not enabled
disabledLeadingIconColor the color of this chip's start icon when not enabled
disabledTrailingIconColor the color of this chip's end icon when not enabled
selectedContainerColor the container color of this chip when selected
disabledSelectedContainerColor the container color of this chip when not enabled and selected
selectedLabelColor the label color of this chip when selected
selectedLeadingIconColor the color of this chip's start icon when selected
selectedTrailingIconColor the color of this chip's end icon when selected

inputChipElevation

@Composable
    fun inputChipElevation(
        elevation: Dp = InputChipTokens.ContainerElevation,
        pressedElevation: Dp = elevation,
        focusedElevation: Dp = elevation,
        hoveredElevation: Dp = elevation,
        draggedElevation: Dp = InputChipTokens.DraggedContainerElevation,
        disabledElevation: Dp = elevation,
    ): SelectableChipElevation

Creates a SelectableChipElevation that will animate between the provided values according to the Material specification for an InputChip.

Parameters

elevation the elevation used when the FilterChip is has no other Interactions
pressedElevation the elevation used when the chip is pressed
focusedElevation the elevation used when the chip is focused
hoveredElevation the elevation used when the chip is hovered
draggedElevation the elevation used when the chip is dragged
disabledElevation the elevation used when the chip is not enabled

inputChipBorder

@Composable
    fun inputChipBorder(
        enabled: Boolean,
        selected: Boolean,
        borderColor: Color = InputChipTokens.UnselectedOutlineColor.value,
        selectedBorderColor: Color = Color.Transparent,
        disabledBorderColor: Color =
            InputChipTokens.DisabledUnselectedOutlineColor.value.copy(
                alpha = InputChipTokens.DisabledUnselectedOutlineOpacity
            ),
        disabledSelectedBorderColor: Color = Color.Transparent,
        borderWidth: Dp = InputChipTokens.UnselectedOutlineWidth,
        selectedBorderWidth: Dp = InputChipTokens.SelectedOutlineWidth,
    ): BorderStroke

Creates a BorderStroke that represents the default border used in an InputChip.

Parameters

selected whether this chip is selected or not
enabled controls the enabled state of this chip. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.
borderColor the border color of this chip when enabled and not selected
selectedBorderColor the border color of this chip when enabled and selected
disabledBorderColor the border color of this chip when not enabled and not selected
disabledSelectedBorderColor the border color of this chip when not enabled but selected
borderWidth the border stroke width of this chip when not selected
selectedBorderWidth the border stroke width of this chip when selected