Start native apps faster with the Composables CLI ->
Object

ChipDefaults

Contains the baseline values used by chips.

Source set: Common
public object ChipDefaults

Contains the baseline values used by chips.

Properties

MinHeight

Source set: Common
public val MinHeight: Dp = 32.dp

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

outlinedBorder

Source set: Common
public val outlinedBorder: BorderStroke

The border used by all types of outlined chips

LeadingIconOpacity

Source set: Common
public const val LeadingIconOpacity: Float = 0.54f

The color opacity used for chip's leading icon color

ContentOpacity

Source set: Common
public const val ContentOpacity: Float = 0.87f

The color opacity used for chip's content color

OutlinedBorderOpacity

Source set: Common
public const val OutlinedBorderOpacity: Float = 0.12f

The color opacity used for the outlined chip's border color

OutlinedBorderSize

Source set: Common
public val OutlinedBorderSize: Dp = 1.dp

The outlined chip's border size

LeadingIconSize

Source set: Common
public val LeadingIconSize: Dp = 20.dp

The size of a chip's leading icon

SelectedIconSize

Source set: Common
public val SelectedIconSize: Dp = 18.dp

The size of a standalone selected icon

Functions

chipColors

Source set: Common
@Composable
    public fun chipColors(
        backgroundColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SurfaceOverlayOpacity)
                .compositeOver(MaterialTheme.colors.surface),
        contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity),
        leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity),
        disabledBackgroundColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = ContentAlpha.disabled * SurfaceOverlayOpacity)
                .compositeOver(MaterialTheme.colors.surface),
        disabledContentColor: Color =
            contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
        disabledLeadingIconContentColor: Color =
            leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity),
    ): ChipColors

Creates a ChipColors that represents the default background and content colors used in a filled Chip.

Parameters

backgroundColor the background color of this chip when enabled
contentColor the content color of this chip when enabled, there is a separate param for icon colors
leadingIconContentColor the color of this chip's start icon when enabled
disabledBackgroundColor the background color of this chip when not enabled
disabledContentColor the content color of this chip when not enabled
disabledLeadingIconContentColor the color of this chip's start icon when not enabled

outlinedChipColors

Source set: Common
@Composable
    public fun outlinedChipColors(
        backgroundColor: Color = MaterialTheme.colors.surface,
        contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity),
        leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity),
        disabledBackgroundColor: Color = backgroundColor,
        disabledContentColor: Color =
            contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
        disabledLeadingIconContentColor: Color =
            leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity),
    ): ChipColors

Creates a ChipColors that represents the default background and content colors used in an outlined Chip.

Parameters

backgroundColor the background color of this chip when enabled
contentColor the content color of this chip when enabled, there is a separate param for icon colors
leadingIconContentColor the leading icon content color of this chip when enabled
disabledBackgroundColor the background color of this chip when not enabled
disabledContentColor the content color of this chip when not enabled
disabledLeadingIconContentColor the color of this chip's start icon when not enabled

filterChipColors

Source set: Common
@Composable
    public fun filterChipColors(
        backgroundColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SurfaceOverlayOpacity)
                .compositeOver(MaterialTheme.colors.surface),
        contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity),
        leadingIconColor: Color = contentColor.copy(LeadingIconOpacity),
        disabledBackgroundColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = ContentAlpha.disabled * SurfaceOverlayOpacity)
                .compositeOver(MaterialTheme.colors.surface),
        disabledContentColor: Color =
            contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
        disabledLeadingIconColor: Color =
            leadingIconColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity),
        selectedBackgroundColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SurfaceOverlayOpacity)
                .compositeOver(backgroundColor),
        selectedContentColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SelectedOverlayOpacity)
                .compositeOver(contentColor),
        selectedLeadingIconColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SelectedOverlayOpacity)
                .compositeOver(leadingIconColor),
    ): SelectableChipColors

Creates a SelectableChipColors that represents the default background and content colors used in a filled FilterChip.

Parameters

backgroundColor the background color of this chip when enabled
contentColor the content color of this chip when enabled
leadingIconColor the color of this chip's start icon when enabled
disabledBackgroundColor the background color of this chip when not enabled
disabledContentColor the content color of this chip when not enabled
disabledLeadingIconColor the color of this chip's start icon when not enabled
selectedBackgroundColor the background color of this chip when selected
selectedContentColor the content color of this chip when selected
selectedLeadingIconColor the color of this chip's start icon when selected

outlinedFilterChipColors

Source set: Common
@Composable
    public fun outlinedFilterChipColors(
        backgroundColor: Color = MaterialTheme.colors.surface,
        contentColor: Color = MaterialTheme.colors.onSurface.copy(ContentOpacity),
        leadingIconColor: Color = contentColor.copy(LeadingIconOpacity),
        disabledBackgroundColor: Color = backgroundColor,
        disabledContentColor: Color =
            contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
        disabledLeadingIconColor: Color =
            leadingIconColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity),
        selectedBackgroundColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SelectedOverlayOpacity)
                .compositeOver(backgroundColor),
        selectedContentColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SelectedOverlayOpacity)
                .compositeOver(contentColor),
        selectedLeadingIconColor: Color =
            MaterialTheme.colors.onSurface
                .copy(alpha = SelectedOverlayOpacity)
                .compositeOver(leadingIconColor),
    ): SelectableChipColors

Creates a ChipColors that represents the default background and content colors used in a selectable outlined FilterChip.

Parameters

backgroundColor the background color of this chip when enabled
contentColor the content color of this chip when enabled
leadingIconColor the color of this chip's start icon when enabled
disabledBackgroundColor the background color of this chip when not enabled
disabledContentColor the content color of this chip when not enabled
disabledLeadingIconColor the color of this chip's start icon when not enabled
selectedBackgroundColor the background color of this chip when selected
selectedContentColor the content color of this chip when selected
selectedLeadingIconColor the color of this chip's start icon when selected