Chip

fun Chip(label: String, onClick: () -> Unit, modifier: Modifier = Modifier, onLongClick: () -> Unit? = null, secondaryLabel: String? = null, iconRtlMode: IconRtlMode = IconRtlMode.Default, icon: Paintable? = null, largeIcon: Boolean = false, colors: ChipColors = ChipDefaults.primaryChipColors(), enabled: Boolean = true)
fun Chip(@StringRes labelId: Int, onClick: () -> Unit, modifier: Modifier = Modifier, onLongClick: () -> Unit? = null, @StringRes secondaryLabel: Int? = null, iconRtlMode: IconRtlMode = IconRtlMode.Default, icon: Paintable? = null, largeIcon: Boolean = false, colors: ChipColors = ChipDefaults.primaryChipColors(), enabled: Boolean = true)

This component is an alternative to Chip, providing the following:

  • a convenient way of providing a label and a secondary label;

  • a convenient way of providing an icon and a placeholder, and choosing their size based on the sizes recommended by the Wear guidelines;


fun Chip(label: String, onClick: () -> Unit, modifier: Modifier = Modifier, onLongClick: () -> Unit? = null, secondaryLabel: String? = null, icon: @Composable BoxScope.() -> Unit? = null, largeIcon: Boolean = false, colors: ChipColors = ChipDefaults.primaryChipColors(), enabled: Boolean = true)

This component is an alternative to Chip, providing the following:

  • a convenient way of providing a label and a secondary label;


fun Chip(label: @Composable RowScope.() -> Unit, onClick: () -> Unit, modifier: Modifier = Modifier, onLongClick: () -> Unit? = null, secondaryLabel: @Composable RowScope.() -> Unit? = null, icon: @Composable BoxScope.() -> Unit? = null, colors: ChipColors = ChipDefaults.primaryChipColors(), enabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, contentPadding: PaddingValues = ChipDefaults.ContentPadding, shape: Shape = MaterialTheme.shapes.large, border: ChipBorder = ChipDefaults.chipBorder())
fun Chip(onClick: () -> Unit, colors: ChipColors, border: ChipBorder, modifier: Modifier = Modifier, onLongClick: () -> Unit? = null, enabled: Boolean = true, contentPadding: PaddingValues = ChipDefaults.ContentPadding, shape: Shape = MaterialTheme.shapes.large, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, role: Role = Role.Button, content: @Composable BoxScope.() -> Unit)

Temporary copy of Wear Compose Material Chip with support for onLongClick.