ChipSelectable

fun ChipSelectable(selected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, onClose: () -> Unit? = null, onCloseLabel: String? = null, intent: ChipIntent = ChipIntent.Basic, style: ChipStyles = ChipStyles.Outlined, enabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, content: @Composable RowScope.() -> Unit?)

Chips help users quickly recognize an important information that has been entered by them, trigger actions, make selections, or filter content.

Parameters

selected
  • whether this chip is selected or not * @param style one of ChipStyles that defines chips background and border colors.

onClose

when provided will add the closing indicator and make it clickable. note that adding it will require onCloseLabel to be provided as well.

onCloseLabel

semantic / accessibility label for the onClose action. It should describe to the user what will happen if onClose is tapped.

intent

The ChipIntent colors that will be used for the content and background of this chip in different states.

style

one of ChipStyles that defines chips background and border.

onClick

called when this chip is clicked

modifier

the Modifier to be applied to this chip

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.

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.

content

a Composable to set as the chip's custom content.


fun ChipSelectable(selected: Boolean, onClick: () -> Unit, text: String?, modifier: Modifier = Modifier, onClose: () -> Unit? = null, onCloseLabel: String? = null, intent: ChipIntent = ChipIntent.Basic, style: ChipStyles = ChipStyles.Outlined, enabled: Boolean = true, leadingIcon: SparkIcon? = null, contentDescription: String? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Chips help users quickly recognize an important information that has been entered by them, trigger actions, make selections, or filter content.

Parameters

style

one of ChipStyles that defines chips background and border.

onClose

when provided will add the closing indicator and make it clickable. note that adding it will require onCloseLabel to be provided as well.

onCloseLabel

semantic / accessibility label for the onClose action. It should describe to the user what will happen if onClose is tapped.

intent

The ChipIntent colors that will be used for the content and background of this chip in different states.

onClick

called when this chip is clicked

modifier

the Modifier to be applied to this chip

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.

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.