Object

FilterChipDefaults

Contains the baseline values used by FilterChip.

Source set: Common

Added in 1.5.0-alpha17

object FilterChipDefaults

Contains the baseline values used by FilterChip.

Properties

Height

Source set: Common

Added in 1.5.0-alpha17

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

Added in 1.5.0-alpha17

val IconSize = FilterChipTokens.IconSize

The size of a filter chip leading icon.

HorizontalSpacing

Source set: Common

Added in 1.5.0-alpha17

val HorizontalSpacing = 8.dp

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

ContentPadding

Source set: Common

Added in 1.5.0-alpha17

val ContentPadding = PaddingValues(horizontal = 8.dp)

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

shape

Source set: Common

Added in 1.5.0-alpha17

val shape: Shape

Default shape of a filter chip.

Functions

horizontalArrangement

Added in 1.5.0-alpha17

fun horizontalArrangement(): Arrangement.Horizontal

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

horizontalArrangement

Added in 1.5.0-alpha17

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

Added in 1.5.0-alpha17

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

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

filterChipColors

Added in 1.5.0-alpha17

@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

Added in 1.5.0-alpha17

@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

Added in 1.5.0-alpha17

@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

Added in 1.5.0-alpha17

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

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

elevatedFilterChipColors

Added in 1.5.0-alpha17

@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

Added in 1.5.0-alpha17

@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