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

Common
@Composable
fun VerticalDivider(
modifier: Modifier = Modifier,
thickness: Dp = DividerDefaults.Thickness,
color: Color = DividerDefaults.color,
) =
Canvas(modifier.fillMaxHeight().width(thickness)) {
drawLine(
color = color,
strokeWidth = thickness.toPx(),
start = Offset(thickness.toPx() / 2, 0f),
end = Offset(thickness.toPx() / 2, size.height),
)
}
Parameters
modifier | the Modifier to be applied to this divider line. |
thickness | thickness of this divider line. Using Dp.Hairline will produce a single pixel divider regardless of screen density. |
color | color of this divider line. |
Create your own Component Library
Material Components are meant to be used as is and they do not allow customizations. To build your own Jetpack Compose component library use Compose Unstyled