Skip to content

SmallTitle

SmallTitle is a basic title component in COUI used to create small-sized title text. It follows the COUI category title style (12sp, medium weight) with preset padding and a 16dp minimum text height.

Import

kotlin
import io.github.suqi8.coui.kmp.basic.SmallTitle

Basic Usage

SmallTitle component can be used to display small title text:

kotlin
SmallTitle(
    text = "Small Title"
)

Customization

Custom Color

kotlin
SmallTitle(
    text = "Small Title with Custom Color",
    textColor = Color.Red
)

Custom Padding

kotlin
SmallTitle(
    text = "Small Title with Custom Padding",
    insideMargin = PaddingValues(16.dp, 4.dp)
)

Properties

SmallTitle Properties

Property NameTypeDescriptionDefault ValueRequired
textStringText content to display-Yes
modifierModifierModifier applied to componentModifierNo
textColorColorTitle text colorCOUITheme.colorScheme.onBackgroundVariantNo
insideMarginPaddingValuesComponent internal paddingSmallTitleDefaults.InsideMarginNo

SmallTitleDefaults Object

The SmallTitleDefaults object provides default values for SmallTitle components.

Constants

Constant NameTypeDescriptionDefault Value
InsideMarginPaddingValuesComponent internal paddingPaddingValues(32.dp, 8.dp)
MinHeightDpMinimum text height16.dp

Advanced Usage

Using with Other Components

kotlin
var checked by remember { mutableStateOf(false) }

Column {
    SmallTitle(text = "Settings")
    Card(
        modifier = Modifier.padding(horizontal = 12.dp).padding(bottom = 12.dp)
    ) {
        SwitchPreference(
            title = "Bluetooth",
            checked = checked,
            onCheckedChange = { checked = it }
        )
    }
    HorizontalDivider(
        modifier = Modifier.padding(horizontal = 12.dp)
    )
    SmallTitle(text = "Advanced Settings")
    // Other settings items
}

Custom Styling

kotlin
SmallTitle(
    text = "Fully Customized Style",
    modifier = Modifier
        .fillMaxWidth()
        .background(Color.LightGray),
    textColor = Color.Blue,
    insideMargin = PaddingValues(32.dp, 12.dp)
)

Changelog

Released under the Apache-2.0 License