State of Compose 2023 results are in! Click here to learn more

← Back to Tv Material

AssistChip

Component
in
Tv Material
. Since 1.0.0-alpha08

Overview

Code Examples

Video

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

@param onClick called when this chip is clicked @param modifier the Modifier to be applied to this chip @param 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 @param onLongClick callback to be called when the surface is long clicked (long-pressed) @param leadingIcon optional icon at the start of the chip, preceding the content text @param trailingIcon optional icon at the end of the chip @param shape Defines the Chip's shape @param colors Color to be used on background and content of the chip @param scale Defines size of the chip relative to its original size @param border Defines a border around the chip @param glow Shadow to be shown behind the chip @param interactionSource the MutableInteractionSource representing the stream of Interactions for this chip. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this chip in different states @param content for this chip, ideally a Text composable

Overloads

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 = remember { MutableInteractionSource() },
    content: @Composable () -> Unit
)

Parameters

NameDescription
onClickcalled when this chip is clicked
modifierthe Modifier to be applied to this chip
enabledcontrols 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
onLongClickcallback to be called when the surface is long clicked (long-pressed)
leadingIconoptional icon at the start of the chip, preceding the content text
trailingIconoptional icon at the end of the chip
shapeDefines the Chip's shape
colorsColor to be used on background and content of the chip
scaleDefines size of the chip relative to its original size
borderDefines a border around the chip
glowShadow to be shown behind the chip
interactionSourcethe MutableInteractionSource representing the stream of Interactions for this chip. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this chip in different states
contentfor this chip, ideally a Text composabl