StylishSection

fun StylishSection(title: String, supportingText: String? = null, modifier: Modifier = Modifier, spacing: Dp = StylishTheme.dimensions.contentSpacing, titleStyle: TextStyle = MaterialTheme.typography.titleMedium, titleColor: Color = MaterialTheme.colorScheme.primary, supportingTextStyle: TextStyle = MaterialTheme.typography.bodyMedium, supportingTextColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, horizontalAlignment: Alignment.Horizontal = Alignment.Start, content: @Composable ColumnScope.() -> Unit)

A titled section that groups a heading, optional supporting text, and arbitrary content under a consistent vertical rhythm (Sectioned structure).

This is a Finish-layer molecule: it composes the StylishSectionTitle atom and spaces the heading, supporting text, and content using the Rhythm spacing scale (StylishTheme.dimensions.contentSpacing by default). Use it to divide a screen into labelled groups — settings panels, forms, detail screens — so that section structure stays consistent. Separate consecutive sections with StylishTheme.dimensions.sectionSpacing.

Parameters

title

Heading text for the section.

supportingText

Optional secondary text rendered below the heading in a muted style. Omitted when null.

spacing

Vertical gap between the heading, supporting text, and content. Defaults to StylishTheme.dimensions.contentSpacing (16 dp).

titleStyle

Typography for the heading. Defaults to MaterialTheme.typography.titleMedium.

titleColor

Color for the heading. Defaults to MaterialTheme.colorScheme.primary.

supportingTextStyle

Typography for supportingText. Defaults to MaterialTheme.typography.bodyMedium.

supportingTextColor

Color for supportingText. Defaults to MaterialTheme.colorScheme.onSurfaceVariant.

horizontalAlignment

Horizontal alignment of the heading, supporting text, and content inside the Column. Defaults to Alignment.Start.

content

The section body, rendered below the heading. Receives ColumnScope.

See also