Object

ChipDefaults

Contains the baseline values used by chips.

Source set: Common

Added in 1.11.0-rc01

@ExperimentalMaterialApi
object ChipDefaults

Contains the baseline values used by chips.

Properties

MinHeight

Source set: Common

Added in 1.11.0-rc01

val MinHeight = 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

Added in 1.11.0-rc01

val outlinedBorder: BorderStroke

The border used by all types of outlined chips

LeadingIconOpacity

Source set: Common

Added in 1.11.0-rc01

const val LeadingIconOpacity = 0.54f

The color opacity used for chip's leading icon color

ContentOpacity

Source set: Common

Added in 1.11.0-rc01

const val ContentOpacity = 0.87f

The color opacity used for chip's content color

OutlinedBorderOpacity

Source set: Common

Added in 1.11.0-rc01

const val OutlinedBorderOpacity = 0.12f

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

OutlinedBorderSize

Source set: Common

Added in 1.11.0-rc01

val OutlinedBorderSize = 1.dp

The outlined chip's border size

LeadingIconSize

Source set: Common

Added in 1.11.0-rc01

val LeadingIconSize = 20.dp

The size of a chip's leading icon

SelectedIconSize

Source set: Common

Added in 1.11.0-rc01

val SelectedIconSize = 18.dp

The size of a standalone selected icon

Functions

chipColors

chipColors

Added in 1.11.0-rc01

@Composable
    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


outlinedChipColors

Added in 1.11.0-rc01

@Composable
    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


filterChipColors

Added in 1.11.0-rc01

@Composable
    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


outlinedFilterChipColors

Added in 1.11.0-rc01

@Composable
    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

Last updated: