InputChip

Functions summary

Unit
@ExperimentalTvMaterial3Api
@NonRestartableComposable
@Composable
InputChip(
    selected: Boolean,
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    onLongClick: (() -> Unit)?,
    leadingIcon: (@Composable () -> Unit)?,
    avatar: (@Composable () -> Unit)?,
    trailingIcon: (@Composable () -> Unit)?,
    shape: SelectableChipShape,
    colors: SelectableChipColors,
    scale: SelectableChipScale,
    border: SelectableChipBorder,
    glow: SelectableChipGlow,
    interactionSource: MutableInteractionSource?,
    content: @Composable () -> Unit
)

Chips help people enter information, make selections, filter content, or trigger actions.

Functions

InputChip

@ExperimentalTvMaterial3Api
@NonRestartableComposable
@Composable
fun InputChip(
    selected: Boolean,
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    onLongClick: (() -> Unit)? = null,
    leadingIcon: (@Composable () -> Unit)? = null,
    avatar: (@Composable () -> Unit)? = null,
    trailingIcon: (@Composable () -> Unit)? = null,
    shape: SelectableChipShape = InputChipDefaults.shape(hasAvatar = avatar != null),
    colors: SelectableChipColors = InputChipDefaults.colors(),
    scale: SelectableChipScale = InputChipDefaults.scale(),
    border: SelectableChipBorder = InputChipDefaults.border(hasAvatar = avatar != null),
    glow: SelectableChipGlow = InputChipDefaults.glow(),
    interactionSource: MutableInteractionSource? = null,
    content: @Composable () -> Unit
): Unit

Chips help people enter information, make selections, filter content, or trigger actions. Chips can show multiple interactive elements together in the same area, such as a list of selectable movie times, or a series of email contacts

Input chips represent discrete pieces of information entered by a user

An Input Chip can have a leading icon or an avatar at its start. In case both are provided, the avatar will take precedence and will be displayed

Parameters
selected: Boolean

whether this chip is selected or not

onClick: () -> Unit

called when this chip is clicked

modifier: Modifier = Modifier

the Modifier to be applied to this chip

enabled: Boolean = true

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

onLongClick: (() -> Unit)? = null

callback to be called when the surface is long clicked (long-pressed)

leadingIcon: (@Composable () -> Unit)? = null

optional icon at the start of the chip, preceding the content text

avatar: (@Composable () -> Unit)? = null

optional avatar at the start of the chip, preceding the content text

trailingIcon: (@Composable () -> Unit)? = null

optional icon at the end of the chip

shape: SelectableChipShape = InputChipDefaults.shape(hasAvatar = avatar != null)

Defines the Chip's shape

colors: SelectableChipColors = InputChipDefaults.colors()

Color to be used on background and content of the chip

scale: SelectableChipScale = InputChipDefaults.scale()

Defines size of the chip relative to its original size

border: SelectableChipBorder = InputChipDefaults.border(hasAvatar = avatar != null)

Defines a border around the chip

glow: SelectableChipGlow = InputChipDefaults.glow()

Shadow to be shown behind the chip

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this chip. You can use this to change the chip's appearance or preview the chip in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable () -> Unit

for this chip, ideally a Text composable