TitleChipDefaults


object TitleChipDefaults


Default values used for TitleChip.

Summary

Public functions

PaddingValues

Default content padding used for a TitleChip

Public properties

Dp

Default spacing between the bottom of a TitleChip and content associated with this title chip, such as a Card.

Public functions

contentPadding

Added in 1.0.0-alpha01
fun contentPadding(hasIcon: Boolean): PaddingValues

Default content padding used for a TitleChip

Parameters
hasIcon: Boolean

whether the TitleChip has an icon specified

Public properties

AssociatedContentSpacing

val AssociatedContentSpacingDp

Default spacing between the bottom of a TitleChip and content associated with this title chip, such as a Card. For example this can be used with a androidx.compose.foundation.layout.Spacer, or with padding.

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.xr.glimmer.Card
import androidx.xr.glimmer.Icon
import androidx.xr.glimmer.Text
import androidx.xr.glimmer.TitleChip
import androidx.xr.glimmer.TitleChipDefaults

Column(horizontalAlignment = Alignment.CenterHorizontally) {
    TitleChip { Text("Title Chip") }
    Spacer(Modifier.height(TitleChipDefaults.AssociatedContentSpacing))
    Card(
        title = { Text("Title") },
        subtitle = { Text("Subtitle") },
        leadingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Card Content")
    }
}