Object

FilterChipDefaults

Contains the baseline values used by FilterChip.

Source set: Common
object FilterChipDefaults

Contains the baseline values used by FilterChip.

Properties

Height

Source set: 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.

IconSize

Source set: Common
val IconSize = FilterChipTokens.IconSize

The size of a filter chip leading icon.

HorizontalSpacing

Source set: Common
val HorizontalSpacing = 8.dp

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

CompactHorizontalSpacing

Source set: Common
@Material3ExpressiveApi val CompactHorizontalSpacing = 4.dp

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

ContentPadding

Source set: Common
val ContentPadding = PaddingValues(horizontal = 8.dp)

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

shape

Source set: 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

@Material3ExpressiveApi
    fun horizontalArrangement(
        hasLeadingIcon: Boolean,
        hasTrailingIcon: Boolean,
    ): Arrangement.Horizontal

Returns the default arrangement of the icons and label within a compact 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

filterChipColors

@Composable fun filterChipColors() = MaterialTheme.colorScheme.defaultFilterChipColors

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

tonalFilterChipColors

@Material3ExpressiveApi
    @Composable
    fun tonalFilterChipColors() = MaterialTheme.colorScheme.defaultTonalFilterChipColors

Creates a SelectableChipColors that represents the default container and content colors used in a tonal 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.

tonalElevatedFilterChipColors

@Material3ExpressiveApi
    @Composable
    fun tonalElevatedFilterChipColors() =
        MaterialTheme.colorScheme.defaultTonalElevatedFilterChipColors

Creates a SelectableChipColors that represents the default container and content colors used in an elevated, tonal 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

shapes

@Material3ExpressiveApi @Composable fun shapes() = MaterialTheme.shapes.defaultChipShapes

Creates a ChipShapes that represents the default shape, pressed shape, and selected shape used in a chip.

shapes

@Material3ExpressiveApi
    @Composable
    fun shapes(
        shape: Shape? = null,
        selectedShape: Shape? = null,
        pressedShape: Shape? = null,
    ): ChipShapes

Creates a ChipShapes that represents the default shape, pressed shape, and selected shape used in a FilterChip and its variants.

Parameters

shape the unchecked shape for ChipShapes
selectedShape the unchecked shape for ChipShapes
pressedShape the pressed shape for ChipShapes

Last updated: