AssistChip

Functions summary

Unit
@ExperimentalTvMaterial3Api
@NonRestartableComposable
@Composable
AssistChip(
    onClick: () -> Unit,
    modifier: Modifier,
    enabled: Boolean,
    onLongClick: (() -> Unit)?,
    leadingIcon: (@Composable () -> Unit)?,
    trailingIcon: (@Composable () -> Unit)?,
    shape: ClickableChipShape,
    colors: ClickableChipColors,
    scale: ClickableChipScale,
    border: ClickableChipBorder,
    glow: ClickableChipGlow,
    interactionSource: MutableInteractionSource?,
    content: @Composable () -> Unit
)

Material Design assist chip

Functions

AssistChip

@ExperimentalTvMaterial3Api
@NonRestartableComposable
@Composable
fun AssistChip(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    onLongClick: (() -> Unit)? = null,
    leadingIcon: (@Composable () -> Unit)? = null,
    trailingIcon: (@Composable () -> Unit)? = null,
    shape: ClickableChipShape = AssistChipDefaults.shape(),
    colors: ClickableChipColors = AssistChipDefaults.colors(),
    scale: ClickableChipScale = AssistChipDefaults.scale(),
    border: ClickableChipBorder = AssistChipDefaults.border(),
    glow: ClickableChipGlow = AssistChipDefaults.glow(),
    interactionSource: MutableInteractionSource? = null,
    content: @Composable () -> Unit
): Unit

Material Design assist chip

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

Assist chips represent smart or automated actions that can span multiple apps, such as opening a calendar event from the home screen. Assist chips function as though the user asked an assistant to complete the action. They should appear dynamically and contextually in a UI

Parameters
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

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

optional icon at the end of the chip

shape: ClickableChipShape = AssistChipDefaults.shape()

Defines the Chip's shape

colors: ClickableChipColors = AssistChipDefaults.colors()

Color to be used on background and content of the chip

scale: ClickableChipScale = AssistChipDefaults.scale()

Defines size of the chip relative to its original size

border: ClickableChipBorder = AssistChipDefaults.border()

Defines a border around the chip

glow: ClickableChipGlow = AssistChipDefaults.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