ChipDefaults


Contains the baseline values used by chips.

Summary

Constants

const Float

The color opacity used for chip's content color

Cmn
const Float

The color opacity used for chip's leading icon color

Cmn
const Float

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

Cmn

Public functions

ChipColors
@Composable
chipColors(
    backgroundColor: Color,
    contentColor: Color,
    leadingIconContentColor: Color,
    disabledBackgroundColor: Color,
    disabledContentColor: Color,
    disabledLeadingIconContentColor: Color
)

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

Cmn
SelectableChipColors
@Composable
filterChipColors(
    backgroundColor: Color,
    contentColor: Color,
    leadingIconColor: Color,
    disabledBackgroundColor: Color,
    disabledContentColor: Color,
    disabledLeadingIconColor: Color,
    selectedBackgroundColor: Color,
    selectedContentColor: Color,
    selectedLeadingIconColor: Color
)

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

Cmn
ChipColors
@Composable
outlinedChipColors(
    backgroundColor: Color,
    contentColor: Color,
    leadingIconContentColor: Color,
    disabledBackgroundColor: Color,
    disabledContentColor: Color,
    disabledLeadingIconContentColor: Color
)

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

Cmn
SelectableChipColors
@Composable
outlinedFilterChipColors(
    backgroundColor: Color,
    contentColor: Color,
    leadingIconColor: Color,
    disabledBackgroundColor: Color,
    disabledContentColor: Color,
    disabledLeadingIconColor: Color,
    selectedBackgroundColor: Color,
    selectedContentColor: Color,
    selectedLeadingIconColor: Color
)

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

Cmn

Public properties

Dp

The size of a chip's leading icon

Cmn
Dp

The min height applied for a chip.

Cmn
Dp

The outlined chip's border size

Cmn
Dp

The size of a standalone selected icon

Cmn
BorderStroke

The border used by all types of outlined chips

Cmn

Constants

ContentOpacity

const val ContentOpacity = 0.87f: Float

The color opacity used for chip's content color

LeadingIconOpacity

const val LeadingIconOpacity = 0.54f: Float

The color opacity used for chip's leading icon color

OutlinedBorderOpacity

const val OutlinedBorderOpacity = 0.12f: Float

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

Public functions

chipColors

@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: Color = MaterialTheme.colors.onSurface.copy(alpha = SurfaceOverlayOpacity) .compositeOver(MaterialTheme.colors.surface)

the background color of this chip when enabled

contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity)

the content color of this chip when enabled, there is a separate param for icon colors

leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity)

the color of this chip's start icon when enabled

disabledBackgroundColor: Color = MaterialTheme.colors.onSurface.copy( alpha = ContentAlpha.disabled * SurfaceOverlayOpacity ).compositeOver(MaterialTheme.colors.surface)

the background color of this chip when not enabled

disabledContentColor: Color = contentColor.copy( alpha = ContentAlpha.disabled * ContentOpacity )

the content color of this chip when not enabled

disabledLeadingIconContentColor: Color = leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity)

the color of this chip's start icon when not enabled

filterChipColors

@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: Color = MaterialTheme.colors.onSurface.copy(alpha = SurfaceOverlayOpacity) .compositeOver(MaterialTheme.colors.surface)

the background color of this chip when enabled

contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity)

the content color of this chip when enabled

leadingIconColor: Color = contentColor.copy(LeadingIconOpacity)

the color of this chip's start icon when enabled

disabledBackgroundColor: Color = MaterialTheme.colors.onSurface.copy( alpha = ContentAlpha.disabled * SurfaceOverlayOpacity ).compositeOver(MaterialTheme.colors.surface)

the background color of this chip when not enabled

disabledContentColor: Color = contentColor.copy( alpha = ContentAlpha.disabled * ContentOpacity )

the content color of this chip when not enabled

disabledLeadingIconColor: Color = leadingIconColor.copy( alpha = ContentAlpha.disabled * LeadingIconOpacity )

the color of this chip's start icon when not enabled

selectedBackgroundColor: Color = MaterialTheme.colors.onSurface.copy( alpha = SurfaceOverlayOpacity ).compositeOver(backgroundColor)

the background color of this chip when selected

selectedContentColor: Color = MaterialTheme.colors.onSurface.copy( alpha = SelectedOverlayOpacity ).compositeOver(contentColor)

the content color of this chip when selected

selectedLeadingIconColor: Color = MaterialTheme.colors.onSurface.copy( alpha = SelectedOverlayOpacity ).compositeOver(leadingIconColor)

the color of this chip's start icon when selected

outlinedChipColors

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

leadingIconContentColor the color of this chip's start icon when enabled

Parameters
backgroundColor: Color = MaterialTheme.colors.surface

the background color of this chip when enabled

contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity)

the content color of this chip when enabled, there is a separate param for icon colors

disabledBackgroundColor: Color = backgroundColor

the background color of this chip when not enabled

disabledContentColor: Color = contentColor.copy( alpha = ContentAlpha.disabled * ContentOpacity )

the content color of this chip when not enabled

disabledLeadingIconContentColor: Color = leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity)

the color of this chip's start icon when not enabled

outlinedFilterChipColors

@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: Color = MaterialTheme.colors.surface

the background color of this chip when enabled

contentColor: Color = MaterialTheme.colors.onSurface.copy(ContentOpacity)

the content color of this chip when enabled

leadingIconColor: Color = contentColor.copy(LeadingIconOpacity)

the color of this chip's start icon when enabled

disabledBackgroundColor: Color = backgroundColor

the background color of this chip when not enabled

disabledContentColor: Color = contentColor.copy( alpha = ContentAlpha.disabled * ContentOpacity )

the content color of this chip when not enabled

disabledLeadingIconColor: Color = leadingIconColor.copy( alpha = ContentAlpha.disabled * LeadingIconOpacity )

the color of this chip's start icon when not enabled

selectedBackgroundColor: Color = MaterialTheme.colors.onSurface.copy( alpha = SelectedOverlayOpacity ).compositeOver(backgroundColor)

the background color of this chip when selected

selectedContentColor: Color = MaterialTheme.colors.onSurface.copy( alpha = SelectedOverlayOpacity ).compositeOver(contentColor)

the content color of this chip when selected

selectedLeadingIconColor: Color = MaterialTheme.colors.onSurface.copy( alpha = SelectedOverlayOpacity ).compositeOver(leadingIconColor)

the color of this chip's start icon when selected

Public properties

LeadingIconSize

val LeadingIconSizeDp

The size of a chip's leading icon

MinHeight

val MinHeightDp

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

OutlinedBorderSize

val OutlinedBorderSizeDp

The outlined chip's border size

SelectedIconSize

val SelectedIconSizeDp

The size of a standalone selected icon

outlinedBorder

val outlinedBorderBorderStroke

The border used by all types of outlined chips