OutlinedChip

Composable Component

Wear Material OutlinedChip that offers three slots and a specific layout for an icon, label and secondaryLabel. The icon and secondaryLabel are optional. The items are laid out with the icon, if provided, at the start of a row, with a column next containing the two label slots.

Android
@Composable
public fun OutlinedChip(
    label: @Composable RowScope.() -> Unit,
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    secondaryLabel: (@Composable RowScope.() -> Unit)? = null,
    icon: (@Composable BoxScope.() -> Unit)? = null,
    colors: ChipColors = ChipDefaults.outlinedChipColors(),
    enabled: Boolean = true,
    interactionSource: MutableInteractionSource? = null,
    contentPadding: PaddingValues = ChipDefaults.ContentPadding,
    shape: Shape = MaterialTheme.shapes.large,
    border: ChipBorder = ChipDefaults.outlinedChipBorder(),
): Unit

Parameters

labelA slot for providing the chip's main label. The contents are expected to be text which is "start" aligned if there is an icon preset and "start" or "center" aligned if not.
onClickWill be called when the user clicks the chip
modifierModifier to be applied to the chip
secondaryLabelA slot for providing the chip's secondary label. The contents are expected to be text which is "start" aligned if there is an icon preset and "start" or "center" aligned if not. label and secondaryLabel contents should be consistently aligned.
iconA slot for providing the chip's icon. The contents are expected to be a horizontally and vertically aligned icon of size ChipDefaults.IconSize or ChipDefaults.LargeIconSize. In order to correctly render when the Chip is not enabled the icon must set its alpha value to LocalContentAlpha.
colorsChipColors that will be used to resolve the background and content color for this chip in different states.
enabledControls the enabled state of the chip. When false, this chip will not be clickable
interactionSourcean optional hoisted MutableInteractionSource for observing and emitting Interactions for this chip. 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
borderChipBorder that will be used to resolve the chip border in different states.