Tag

fun Tag(label: String, modifier: Modifier = Modifier, color: TagColor = TagColor.Default, iconResource: Int? = null, counter: String? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onClick: () -> Unit? = null)(source)

Tag is used to classify and link to content.

Parameters

label

Text label.

modifier

Modifier to be applied to the layout of the component.

color

Colors of choice for the component background.

iconResource

Optional leading icon.

counter

Optional trailing counter label.

interactionSource

The MutableInteractionSource representing the stream of Interactions for this component.

onClick

optional click action.

See also

Samples

SkapaTheme2(isSystemInDarkTheme()) {
    Column {
        Tag(label = "Label", color = TagColor.Default) {}
        Tag(label = "Label + icon", color = TagColor.Default, iconResource = R.drawable.ic_avatar_person) {}
        Tag(label = "Label + counter", color = TagColor.Default, counter = "8") {}
        Tag(label = "Label + icon + counter", color = TagColor.Default, iconResource = R.drawable.ic_avatar_person, counter = "8") {}
    }
}

fun Tag(label: String, modifier: Modifier = Modifier, color: TagColor = TagColor.Default, iconResource: Int? = null, iconTinting: Boolean = true, counter: String? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onClick: () -> Unit? = null)(source)

Tag is used to classify and link to content.

Parameters

label

Text label.

modifier

Modifier to be applied to the layout of the component.

color

Colors of choice for the component background.

iconResource

Optional leading icon.

iconTinting

Whether the icon should be tinted or not by default to the color. Should only be set to false for multicolored icons. Will in this case use Color.Unspecified.

counter

Optional trailing counter label.

interactionSource

The MutableInteractionSource representing the stream of Interactions for this component.

onClick

optional click action.

See also

Samples

SkapaTheme2(isSystemInDarkTheme()) {
    Column {
        Tag(label = "Label", color = TagColor.Default) {}
        Tag(label = "Label + icon", color = TagColor.Default, iconResource = R.drawable.ic_avatar_person) {}
        Tag(label = "Label + counter", color = TagColor.Default, counter = "8") {}
        Tag(label = "Label + icon + counter", color = TagColor.Default, iconResource = R.drawable.ic_avatar_person, counter = "8") {}
    }
}