We just launched Compose Examples featuring over 150+ components! Check it out →

Divider

Common

Component in Material Compose

A divider is a thin line that groups content in lists and layouts.

Dividers
image

Last updated:

Installation

dependencies {
   implementation("androidx.compose.material:material:1.8.0-alpha04")
}

Overloads

@Composable
fun Divider(
    modifier: Modifier = Modifier,
    color: Color = MaterialTheme.colors.onSurface.copy(alpha = DividerAlpha),
    thickness: Dp = 1.dp,
    startIndent: Dp = 0.dp
)

Parameters

namedescription
modifierModifier to be applied to the divider line
colorcolor of the divider line
thicknessthickness of the divider line, 1 dp is used by default. Using [Dp.Hairline] will produce a single pixel divider regardless of screen density.
startIndentstart offset of this line, no offset by default
by @alexstyl