StylishSectionTitle

fun StylishSectionTitle(title: String, modifier: Modifier = Modifier, maxLines: Int = Int.MAX_VALUE, overflow: TextOverflow = TextOverflow.Ellipsis, textStyle: TextStyle = MaterialTheme.typography.titleMedium, color: Color = MaterialTheme.colorScheme.primary, verticalPadding: Dp = 20.dp)

A section heading label rendered in the primary color. Provides consistent typography and vertical rhythm for group headers within lists, forms, and detail screens. The text is announced as a heading by accessibility services.

The text is padded vertically by verticalPadding to create breathing room between the preceding section's content and the next section's body. When maxLines is reached, overflow controls how the excess text is handled.

The root carries the default test tag stylish_sectiontitle for UI tests; callers can override it by passing their own Modifier.testTag(...) in modifier.

Parameters

title

Heading text to display.

maxLines

Maximum number of visible lines. Defaults to Int.MAX_VALUE (unlimited).

overflow

Strategy applied when text exceeds maxLines. Defaults to TextOverflow.Ellipsis.

textStyle

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

color

Text color. Defaults to MaterialTheme.colorScheme.primary.

verticalPadding

Symmetric vertical padding applied above and below the text. Defaults to 20 dp.