androidx.compose.material3

SuggestionChip

Composable function

One of the chip types. It works like AssistChip. Only the parameters that differ are described here.

A chip with a suggested reply or action, often made by the app.

Suggestion chips
Suggestion chips
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
    SuggestionChip(onClick = {}, label = { Text("Sounds good") })
    SuggestionChip(onClick = {}, label = { Text("See you then") })
}

Parameters

@Composable
fun SuggestionChip(
    onClick: () -> Unit,
    label: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    icon: @Composable (() -> Unit)? = null,
    shape: Shape = SuggestionChipDefaults.shape,
    colors: ChipColors = SuggestionChipDefaults.suggestionChipColors(),
    elevation: ChipElevation? = SuggestionChipDefaults.suggestionChipElevation(),
    border: BorderStroke? = SuggestionChipDefaults.suggestionChipBorder(enabled),
    horizontalArrangement: Arrangement.Horizontal = SuggestionChipDefaults.horizontalArrangement(),
    contentPadding: PaddingValues = SuggestionChipDefaults.ContentPadding,
    interactionSource: MutableInteractionSource? = null,
)

icon: @Composable (() -> Unit)?Optional

Default: null

An icon before the label. Only on SuggestionChip.

Defaults that differ from AssistChip:

Same as in AssistChip: onClick, label, modifier, enabled, shape, colors, elevation, border, horizontalArrangement, contentPadding, interactionSource.

Chip types

See also