Object

FilterChipDefaults

Contains the baseline values used by FilterChip.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
object FilterChipDefaults

Contains the baseline values used by FilterChip.

Properties

Common
val Height = FilterChipTokens.ContainerHeight

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

Common
val IconSize = FilterChipTokens.IconSize

The size of a filter chip leading icon.

Common
val HorizontalSpacing = 8.dp

The spacing between the icon and label of a filter chip.

Common
val ContentPadding = PaddingValues(horizontal = 8.dp)

The padding around the content of this chip, including the leadingIcon, label, and trailingIcon

Common
val shape: Shape

Default shape of a filter chip.

Functions

horizontalArrangement

fun horizontalArrangement(): Arrangement.Horizontal

Returns the default arrangement of the icons and label within a filter chip.


horizontalArrangement

fun horizontalArrangement(spacing: Dp): Arrangement.Horizontal

Creates an Arrangement.Horizontal that represents the default arrangement of the icons and label within a filter chip.

Parameters

spacing the spacing between the icon and label
@Composable fun filterChipColors() = MaterialTheme.colorScheme.defaultFilterChipColors

Creates a SelectableChipColors that represents the default container and content colors used in a flat FilterChip.


filterChipColors

@Composable
    fun filterChipColors(
        containerColor: Color = Color.Unspecified,
        labelColor: Color = Color.Unspecified,
        iconColor: 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 and content colors used in a flat FilterChip.

Parameters

containerColor the container color of this chip when enabled
labelColor the label color of this chip when enabled
iconColor the color of this chip's start and end icons 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

filterChipElevation

@Composable
    fun filterChipElevation(
        elevation: Dp = FilterChipTokens.FlatContainerElevation,
        pressedElevation: Dp = FilterChipTokens.FlatSelectedPressedContainerElevation,
        focusedElevation: Dp = FilterChipTokens.FlatSelectedFocusContainerElevation,
        hoveredElevation: Dp = FilterChipTokens.FlatSelectedHoverContainerElevation,
        draggedElevation: Dp = FilterChipTokens.DraggedContainerElevation,
        disabledElevation: Dp = elevation,
    ): SelectableChipElevation

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

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

filterChipBorder

@Composable
    fun filterChipBorder(
        enabled: Boolean,
        selected: Boolean,
        borderColor: Color = FilterChipTokens.FlatUnselectedOutlineColor.value,
        selectedBorderColor: Color = Color.Transparent,
        disabledBorderColor: Color =
            FilterChipTokens.FlatDisabledUnselectedOutlineColor.value.copy(
                alpha = FilterChipTokens.FlatDisabledUnselectedOutlineOpacity
            ),
        disabledSelectedBorderColor: Color = Color.Transparent,
        borderWidth: Dp = FilterChipTokens.FlatUnselectedOutlineWidth,
        selectedBorderWidth: Dp = FilterChipTokens.FlatSelectedOutlineWidth,
    ): BorderStroke

Creates a BorderStroke that represents the default border used in a flat FilterChip.

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

elevatedFilterChipColors

@Composable
    fun elevatedFilterChipColors() = MaterialTheme.colorScheme.defaultElevatedFilterChipColors

Creates a SelectableChipColors that represents the default container and content colors used in an elevated FilterChip.


elevatedFilterChipColors

@Composable
    fun elevatedFilterChipColors(
        containerColor: Color = Color.Unspecified,
        labelColor: Color = Color.Unspecified,
        iconColor: 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 and content colors used in an elevated FilterChip.

Parameters

containerColor the container color of this chip when enabled
labelColor the label color of this chip when enabled
iconColor the color of this chip's start and end icons 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

elevatedFilterChipElevation

@Composable
    fun elevatedFilterChipElevation(
        elevation: Dp = FilterChipTokens.ElevatedContainerElevation,
        pressedElevation: Dp = FilterChipTokens.ElevatedPressedContainerElevation,
        focusedElevation: Dp = FilterChipTokens.ElevatedFocusContainerElevation,
        hoveredElevation: Dp = FilterChipTokens.ElevatedHoverContainerElevation,
        draggedElevation: Dp = FilterChipTokens.DraggedContainerElevation,
        disabledElevation: Dp = FilterChipTokens.ElevatedDisabledContainerElevation,
    ): SelectableChipElevation

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

Parameters

elevation the elevation used when the chip 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