Object

FilterChipDefaults

Contains the default values used by FilterChip.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
@ExperimentalTvMaterial3Api
object FilterChipDefaults

Contains the default values used by FilterChip.

Properties

Android
val ContainerHeight = 36.dp

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

Android
val IconSize = 18.dp

The size of a Filter chip icon

Android
val ContainerShape = RoundedCornerShape(8.dp)

The default Shape applied to a filter chip

Functions

shape

fun shape(
        shape: Shape = ContainerShape,
        focusedShape: Shape = shape,
        pressedShape: Shape = shape,
        selectedShape: Shape = shape,
        disabledShape: Shape = shape,
        focusedSelectedShape: Shape = shape,
        focusedDisabledShape: Shape = disabledShape,
        pressedSelectedShape: Shape = shape,
        selectedDisabledShape: Shape = disabledShape,
        focusedSelectedDisabledShape: Shape = disabledShape,
    ) =
        SelectableChipShape(
            shape = shape,
            focusedShape = focusedShape,
            pressedShape = pressedShape,
            selectedShape = selectedShape,
            disabledShape = disabledShape,
            focusedSelectedShape = focusedSelectedShape,
            focusedDisabledShape = focusedDisabledShape,
            pressedSelectedShape = pressedSelectedShape,
            selectedDisabledShape = selectedDisabledShape,
            focusedSelectedDisabledShape = focusedSelectedDisabledShape,
        )

Creates a SelectableChipShape that represents the default container shapes used in a FilterChip

Parameters

shape the shape used when the Chip is enabled, and has no other Interactions
focusedShape the shape used when the Chip is enabled and focused
pressedShape the shape used when the Chip is enabled and pressed
selectedShape the shape used when the Chip is enabled and selected
disabledShape the shape used when the Chip is not enabled
focusedSelectedShape the shape used when the Chip is enabled, focused and selected
focusedDisabledShape the shape used when the Chip is not enabled and focused
pressedSelectedShape the shape used when the Chip is enabled, pressed and selected
selectedDisabledShape the shape used when the Chip is not enabled and selected
focusedSelectedDisabledShape the shape used when the Chip is not enabled, focused and selected

colors

@ReadOnlyComposable
    @Composable
    fun colors(
        containerColor: Color = Color.Transparent,
        contentColor: Color = MaterialTheme.colorScheme.onSurfaceVariant,
        focusedContainerColor: Color = MaterialTheme.colorScheme.onSurface,
        focusedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
        pressedContainerColor: Color = MaterialTheme.colorScheme.onSurfaceVariant,
        pressedContentColor: Color = MaterialTheme.colorScheme.surface,
        selectedContainerColor: Color =
            MaterialTheme.colorScheme.secondaryContainer.copy(
                alpha = SelectedBackgroundColorOpacity
            ),
        selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer,
        disabledContainerColor: Color =
            MaterialTheme.colorScheme.surfaceVariant.copy(alpha = DisabledBackgroundColorOpacity),
        disabledContentColor: Color =
            MaterialTheme.colorScheme.border.copy(alpha = DisabledContentColorOpacity),
        focusedSelectedContainerColor: Color = MaterialTheme.colorScheme.onPrimaryContainer,
        focusedSelectedContentColor: Color = MaterialTheme.colorScheme.onPrimary,
        pressedSelectedContainerColor: Color = MaterialTheme.colorScheme.secondary,
        pressedSelectedContentColor: Color = MaterialTheme.colorScheme.onSecondary,
    ) =
        SelectableChipColors(
            containerColor = containerColor,
            contentColor = contentColor,
            focusedContainerColor = focusedContainerColor,
            focusedContentColor = focusedContentColor,
            pressedContainerColor = pressedContainerColor,
            pressedContentColor = pressedContentColor,
            selectedContainerColor = selectedContainerColor,
            selectedContentColor = selectedContentColor,
            disabledContainerColor = disabledContainerColor,
            disabledContentColor = disabledContentColor,
            focusedSelectedContainerColor = focusedSelectedContainerColor,
            focusedSelectedContentColor = focusedSelectedContentColor,
            pressedSelectedContainerColor = pressedSelectedContainerColor,
            pressedSelectedContentColor = pressedSelectedContentColor,
        )

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

Parameters

containerColor the container color used when the Chip is enabled, and has no other Interactions
contentColor the content color used when the Chip is enabled, and has no other Interactions
focusedContainerColor the container color used when the Chip is enabled and focused
focusedContentColor the content color used when the Chip is enabled and focused
pressedContainerColor the container color used when the Chip is enabled and pressed
pressedContentColor the content color used when the Chip is enabled and pressed
selectedContainerColor the container color used when the Chip is enabled and selected
selectedContentColor the content color used when the Chip is enabled and selected
disabledContainerColor the container color used when the Chip is not enabled
disabledContentColor the content color used when the Chip is not enabled
focusedSelectedContainerColor the container color used when the Chip is enabled, focused and selected
focusedSelectedContentColor the content color used when the Chip is enabled, focused and selected
pressedSelectedContainerColor the container color used when the Chip is enabled, pressed and selected
pressedSelectedContentColor the content color used when the Chip is enabled, pressed and selected

scale

fun scale(
        @FloatRange(from = 0.0) scale: Float = 1f,
        @FloatRange(from = 0.0) focusedScale: Float = 1.1f,
        @FloatRange(from = 0.0) pressedScale: Float = scale,
        @FloatRange(from = 0.0) selectedScale: Float = scale,
        @FloatRange(from = 0.0) disabledScale: Float = scale,
        @FloatRange(from = 0.0) focusedSelectedScale: Float = focusedScale,
        @FloatRange(from = 0.0) focusedDisabledScale: Float = disabledScale,
        @FloatRange(from = 0.0) pressedSelectedScale: Float = scale,
        @FloatRange(from = 0.0) selectedDisabledScale: Float = disabledScale,
        @FloatRange(from = 0.0) focusedSelectedDisabledScale: Float = disabledScale,
    ) =
        SelectableChipScale(
            scale = scale,
            focusedScale = focusedScale,
            pressedScale = pressedScale,
            selectedScale = selectedScale,
            disabledScale = disabledScale,
            focusedSelectedScale = focusedSelectedScale,
            focusedDisabledScale = focusedDisabledScale,
            pressedSelectedScale = pressedSelectedScale,
            selectedDisabledScale = selectedDisabledScale,
            focusedSelectedDisabledScale = focusedSelectedDisabledScale,
        )

Creates a SelectableChipScale that represents the default scaleFactors used in a FilterChip. scaleFactors are used to modify the size of a composable in different Interaction states e.g. 1f (original) in default state, 1.2f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc

Parameters

scale the scaleFactor used when the Chip is enabled, and has no other Interactions
focusedScale the scaleFactor used when the Chip is enabled and focused
pressedScale the scaleFactor used when the Chip is enabled and pressed
selectedScale the scaleFactor used when the Chip is enabled and selected
disabledScale the scaleFactor used when the Chip is not enabled
focusedSelectedScale the scaleFactor used when the Chip is enabled, focused and selected
focusedDisabledScale the scaleFactor used when the Chip is not enabled and focused
pressedSelectedScale the scaleFactor used when the Chip is enabled, pressed and selected
selectedDisabledScale the scaleFactor used when the Chip is not enabled and selected
focusedSelectedDisabledScale the scaleFactor used when the Chip is not enabled, focused and selected

border

@ReadOnlyComposable
    @Composable
    fun border(
        border: Border =
            Border(
                border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.border),
                shape = ContainerShape,
            ),
        focusedBorder: Border = Border.None,
        pressedBorder: Border = focusedBorder,
        selectedBorder: Border =
            Border(
                border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.secondary),
                shape = ContainerShape,
            ),
        disabledBorder: Border =
            Border(
                border =
                    BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.surfaceVariant),
                shape = ContainerShape,
            ),
        focusedSelectedBorder: Border =
            Border(
                border =
                    BorderStroke(
                        width = 1.1.dp,
                        color = MaterialTheme.colorScheme.onPrimaryContainer,
                    ),
                shape = ContainerShape,
            ),
        focusedDisabledBorder: Border = border,
        pressedSelectedBorder: Border = Border.None,
        selectedDisabledBorder: Border = Border.None,
        focusedSelectedDisabledBorder: Border = border,
    ) =
        SelectableChipBorder(
            border = border,
            focusedBorder = focusedBorder,
            pressedBorder = pressedBorder,
            selectedBorder = selectedBorder,
            disabledBorder = disabledBorder,
            focusedSelectedBorder = focusedSelectedBorder,
            focusedDisabledBorder = focusedDisabledBorder,
            pressedSelectedBorder = pressedSelectedBorder,
            selectedDisabledBorder = selectedDisabledBorder,
            focusedSelectedDisabledBorder = focusedSelectedDisabledBorder,
        )

Creates a SelectableChipBorder that represents the default Borders applied on a FilterChip in different Interaction states

Parameters

border the Border used when the Chip is enabled, and has no other Interactions
focusedBorder the Border used when the Chip is enabled and focused
pressedBorder the Border used when the Chip is enabled and pressed
selectedBorder the Border used when the Chip is enabled and selected
disabledBorder the Border used when the Chip is not enabled
focusedSelectedBorder the Border used when the Chip is enabled, focused and selected
focusedDisabledBorder the Border used when the Chip is not enabled and focused
pressedSelectedBorder the Border used when the Chip is enabled, pressed and selected
selectedDisabledBorder the Border used when the Chip is not enabled and selected
focusedSelectedDisabledBorder the Border used when the Chip is not enabled, focused and selected

glow

fun glow(
        glow: Glow = Glow.None,
        focusedGlow: Glow = glow,
        pressedGlow: Glow = glow,
        selectedGlow: Glow = glow,
        focusedSelectedGlow: Glow = focusedGlow,
        pressedSelectedGlow: Glow = glow,
    ) =
        SelectableChipGlow(
            glow = glow,
            focusedGlow = focusedGlow,
            pressedGlow = pressedGlow,
            selectedGlow = selectedGlow,
            focusedSelectedGlow = focusedSelectedGlow,
            pressedSelectedGlow = pressedSelectedGlow,
        )

Creates a SelectableChipGlow that represents the default Glows used in a FilterChip

Parameters

glow the Glow used when the Chip is enabled, and has no other Interactions
focusedGlow the Glow used when the Chip is enabled and focused
pressedGlow the Glow used when the Chip is enabled and pressed
selectedGlow the Glow used when the Chip is enabled and selected
focusedSelectedGlow the Glow used when the Chip is enabled, focused and selected
pressedSelectedGlow the Glow used when the Chip is enabled, pressed and selected