SplitSelectableChip

Composable Component

A SplitSelectableChip is a specialized type of Chip that includes a slot for a selection control, such as a radio button. The SplitSelectableChip differs from the SelectableChip by having two "tappable" areas, one clickable and one selectable.

Android
@Composable
public fun SplitSelectableChip(
    selected: Boolean,
    onSelectionClick: (Boolean) -> Unit,
    label: @Composable RowScope.() -> Unit,
    onContainerClick: () -> Unit,
    modifier: Modifier = Modifier,
    secondaryLabel: @Composable (RowScope.() -> Unit)? = null,
    colors: SplitSelectableChipColors = SelectableChipDefaults.splitSelectableChipColors(),
    enabled: Boolean = true,
    selectionInteractionSource: MutableInteractionSource? = null,
    containerInteractionSource: MutableInteractionSource? = null,
    contentPadding: PaddingValues = SelectableChipDefaults.ContentPadding,
    shape: Shape = MaterialTheme.shapes.large,
    selectionControl: @Composable BoxScope.() -> Unit = {
        RadioButton(selected = selected, enabled = enabled)
    },
): Unit

Parameters

selectedBoolean flag indicating whether this button is currently selected.
onSelectionClickCallback to be invoked when this button is selected.
labelA slot for providing the chip's main label. The contents are expected to be text which is "start" aligned.
onContainerClickCallback to be invoked when the user clicks the main body of the chip, the area containing the labels.
modifierModifier to be applied to the chip
secondaryLabelA slot for providing the chip's secondary label. The contents are expected to be "start" or "center" aligned. label and secondaryLabel contents should be consistently aligned.
colorsSplitSelectableChipColors that will be used to resolve the background and content color for this chip in different states, see SelectableChipDefaults.splitSelectableChipColors.
enabledControls the enabled state of the chip. When false, this chip will not be clickable
selectionInteractionSourcean optional hoisted MutableInteractionSource for observing and emitting Interactions for this chip's "selectable" tap area. You can use this to change the chip's appearance or preview the chip in different states. Note that if null is provided, interactions will still happen internally.
containerInteractionSourcean optional hoisted MutableInteractionSource for observing and emitting Interactions for this chip's "clickable" tap area. You can use this to change the chip's appearance or preview the chip in different states. Note that if null is provided, interactions will still happen internally.
contentPaddingThe spacing values to apply internally between the container and the content
shapeDefines the chip's shape. It is strongly recommended to use the default as this shape is a key characteristic of the Wear Material Theme
selectionControlA slot for providing the chip's selection control. One built-in selection control is provided, see RadioButton. For Checkbox and Switch, use SplitToggleChip instead.