FilterChip
Functions summary
Unit |
@ExperimentalTvMaterial3ApiMaterial Design filter chip |
Functions
FilterChip
@ExperimentalTvMaterial3Api
@NonRestartableComposable
@Composable
fun FilterChip(
selected: Boolean,
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
onLongClick: (() -> Unit)? = null,
leadingIcon: (@Composable () -> Unit)? = null,
trailingIcon: (@Composable () -> Unit)? = null,
shape: SelectableChipShape = FilterChipDefaults.shape(),
colors: SelectableChipColors = FilterChipDefaults.colors(),
scale: SelectableChipScale = FilterChipDefaults.scale(),
border: SelectableChipBorder = FilterChipDefaults.border(),
glow: SelectableChipGlow = FilterChipDefaults.glow(),
interactionSource: MutableInteractionSource? = null,
content: @Composable () -> Unit
): Unit
Material Design filter 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
Filter chips use tags or descriptive words to filter content. They can be a good alternative to toggle buttons or checkboxes
Tapping on a filter chip toggles its selection state. A selection state leadingIcon can be provided (e.g. a checkmark) to be appended at the starting edge of the chip's label
| Parameters | |
|---|---|
selected: Boolean |
whether this chip is selected or not |
onClick: () -> Unit |
called when this chip is clicked |
modifier: Modifier = Modifier |
the |
enabled: Boolean = true |
controls the enabled state of this chip. When |
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 |
trailingIcon: (@Composable () -> Unit)? = null |
optional icon at the end of the chip |
shape: SelectableChipShape = FilterChipDefaults.shape() |
Defines the Chip's shape |
colors: SelectableChipColors = FilterChipDefaults.colors() |
Color to be used on background and content of the chip |
scale: SelectableChipScale = FilterChipDefaults.scale() |
Defines size of the chip relative to its original size |
border: SelectableChipBorder = FilterChipDefaults.border() |
Defines a border around the chip |
glow: SelectableChipGlow = FilterChipDefaults.glow() |
Shadow to be shown behind the chip |
interactionSource: MutableInteractionSource? = null |
an optional hoisted |
content: @Composable () -> Unit |
for this chip, ideally a Text composable |