Chip

Chip

A compact element that represents an input, attribute, or action.


Installation

./gradlew lumo --add Chip

Usage

Basic Chip

Chip(
    onClick = { /* Handle click */ }
) {
    Text("Basic Chip")
}

Chip with Icon

Chip(
    onClick = { /* Handle click */ },
    leadingIcon = {
        Icon(
            Icons.Default.Star,
            contentDescription = null,
            modifier = Modifier.size(ChipDefaults.ChipIconSize)
        )
    }
) {
    Text("Chip with Icon")
}

API Documentation

Chip Types

ComponentDescription
ChipBasic chip with optional onClick
ElevatedChipChip with elevation and shadow
OutlinedChipChip with border and no default elevation

Parameters

ParameterTypeDescription
modifierModifierModifier for the chip
enabledBooleanWhether the chip is enabled
selectedBooleanWhether the chip is selected
onClick() -> UnitCallback when chip is clicked
contentPaddingPaddingValuesPadding around chip content
shapeShapeShape of the chip
leadingIcon@Composable (() -> Unit)?Optional icon before content
trailingIcon@Composable (() -> Unit)?Optional icon after content
label@Composable () -> UnitContent to display inside the chip
interactionSourceMutableInteractionSourceSource of interactions for the chip