{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

InputChipDefaults

public static class InputChipDefaults


Contains the baseline values used by an InputChip.

Summary

Public fields

static @NonNull InputChipDefaults

Public methods

final @NonNull Dp

The size of an input chip avatar.

final @NonNull Dp

The height applied for an input chip.

final @NonNull Dp

The size of an input chip icon.

final @NonNull Shape

Default shape of an input chip.

final @NonNull BorderStroke
@Composable
inputChipBorder(
    boolean enabled,
    boolean selected,
    @NonNull Color borderColor,
    @NonNull Color selectedBorderColor,
    @NonNull Color disabledBorderColor,
    @NonNull Color disabledSelectedBorderColor,
    @NonNull Dp borderWidth,
    @NonNull Dp selectedBorderWidth
)

Creates a BorderStroke that represents the default border used in an InputChip.

final @NonNull SelectableChipColors

Creates a SelectableChipColors that represents the default container, label, and icon colors used in an InputChip.

final @NonNull SelectableChipColors
@Composable
inputChipColors(
    @NonNull Color containerColor,
    @NonNull Color labelColor,
    @NonNull Color leadingIconColor,
    @NonNull Color trailingIconColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledLabelColor,
    @NonNull Color disabledLeadingIconColor,
    @NonNull Color disabledTrailingIconColor,
    @NonNull Color selectedContainerColor,
    @NonNull Color disabledSelectedContainerColor,
    @NonNull Color selectedLabelColor,
    @NonNull Color selectedLeadingIconColor,
    @NonNull Color selectedTrailingIconColor
)

Creates a SelectableChipColors that represents the default container, label, and icon colors used in an InputChip.

final @NonNull SelectableChipElevation
@Composable
inputChipElevation(
    @NonNull Dp elevation,
    @NonNull Dp pressedElevation,
    @NonNull Dp focusedElevation,
    @NonNull Dp hoveredElevation,
    @NonNull Dp draggedElevation,
    @NonNull Dp disabledElevation
)

Creates a SelectableChipElevation that will animate between the provided values according to the Material specification for an InputChip.

Public fields

INSTANCE

public static @NonNull InputChipDefaults INSTANCE

Public methods

getAvatarSize

public final @NonNull Dp getAvatarSize()

The size of an input chip avatar.

getHeight

public final @NonNull Dp getHeight()

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

getIconSize

public final @NonNull Dp getIconSize()

The size of an input chip icon.

getShape

@Composable
public final @NonNull Shape getShape()

Default shape of an input chip.

inputChipBorder

@Composable
public final @NonNull BorderStroke inputChipBorder(
    boolean enabled,
    boolean selected,
    @NonNull Color borderColor,
    @NonNull Color selectedBorderColor,
    @NonNull Color disabledBorderColor,
    @NonNull Color disabledSelectedBorderColor,
    @NonNull Dp borderWidth,
    @NonNull Dp selectedBorderWidth
)

Creates a BorderStroke that represents the default border used in an InputChip.

Parameters
boolean 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.

boolean selected

whether this chip is selected or not

@NonNull Color borderColor

the border color of this chip when enabled and not selected

@NonNull Color selectedBorderColor

the border color of this chip when enabled and selected

@NonNull Color disabledBorderColor

the border color of this chip when not enabled and not selected

@NonNull Color disabledSelectedBorderColor

the border color of this chip when not enabled but selected

@NonNull Dp borderWidth

the border stroke width of this chip when not selected

@NonNull Dp selectedBorderWidth

the border stroke width of this chip when selected

inputChipColors

@Composable
public final @NonNull SelectableChipColors inputChipColors()

Creates a SelectableChipColors that represents the default container, label, and icon colors used in an InputChip.

inputChipColors

@Composable
public final @NonNull SelectableChipColors inputChipColors(
    @NonNull Color containerColor,
    @NonNull Color labelColor,
    @NonNull Color leadingIconColor,
    @NonNull Color trailingIconColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledLabelColor,
    @NonNull Color disabledLeadingIconColor,
    @NonNull Color disabledTrailingIconColor,
    @NonNull Color selectedContainerColor,
    @NonNull Color disabledSelectedContainerColor,
    @NonNull Color selectedLabelColor,
    @NonNull Color selectedLeadingIconColor,
    @NonNull Color selectedTrailingIconColor
)

Creates a SelectableChipColors that represents the default container, label, and icon colors used in an InputChip.

Parameters
@NonNull Color containerColor

the container color of this chip when enabled

@NonNull Color labelColor

the label color of this chip when enabled

@NonNull Color leadingIconColor

the color of this chip's start icon when enabled

@NonNull Color trailingIconColor

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

@NonNull Color disabledContainerColor

the container color of this chip when not enabled

@NonNull Color disabledLabelColor

the label color of this chip when not enabled

@NonNull Color disabledLeadingIconColor

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

@NonNull Color disabledTrailingIconColor

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

@NonNull Color selectedContainerColor

the container color of this chip when selected

@NonNull Color disabledSelectedContainerColor

the container color of this chip when not enabled and selected

@NonNull Color selectedLabelColor

the label color of this chip when selected

@NonNull Color selectedLeadingIconColor

the color of this chip's start icon when selected

@NonNull Color selectedTrailingIconColor

the color of this chip's end icon when selected

inputChipElevation

@Composable
public final @NonNull SelectableChipElevation inputChipElevation(
    @NonNull Dp elevation,
    @NonNull Dp pressedElevation,
    @NonNull Dp focusedElevation,
    @NonNull Dp hoveredElevation,
    @NonNull Dp draggedElevation,
    @NonNull Dp disabledElevation
)

Creates a SelectableChipElevation that will animate between the provided values according to the Material specification for an InputChip.

Parameters
@NonNull Dp elevation

the elevation used when the FilterChip is has no other Interactions

@NonNull Dp pressedElevation

the elevation used when the chip is pressed

@NonNull Dp focusedElevation

the elevation used when the chip is focused

@NonNull Dp hoveredElevation

the elevation used when the chip is hovered

@NonNull Dp draggedElevation

the elevation used when the chip is dragged

@NonNull Dp disabledElevation

the elevation used when the chip is not enabled