Stay organized with collections
Save and categorize content based on your preferences.
Dividers are thin lines that separate items in lists or other
containers. You can implement dividers in your app using the HorizontalDivider
and VerticalDivider composables.
Both components provide parameters for modifying their appearance:
thickness: Use this parameter to specify the thickness of the divider
line.
color: Use this parameter to specify the color of the divider line.
Horizontal divider example
The following example demonstrates an implementation of the
HorizontalDivider component. It uses the thickness parameter to control the
height of the line:
@ComposablefunHorizontalDividerExample(){Column(verticalArrangement=Arrangement.spacedBy(8.dp),){Text("First item in list")HorizontalDivider(thickness=2.dp)Text("Second item in list")}}
This implementation renders a thin horizontal line between two text components:
Figure 1. A horizontal divider separating two text components.
Vertical divider example
The following example demonstrates an implementation of the
VerticalDivider component. It uses the color parameter to provide a custom
color for the line:
@ComposablefunVerticalDividerExample(){Row(modifier=Modifier.fillMaxWidth().height(IntrinsicSize.Min),horizontalArrangement=Arrangement.SpaceEvenly){Text("First item in row")VerticalDivider(color=MaterialTheme.colorScheme.secondary)Text("Second item in row")}}
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[],[],null,["# Divider\n\n[Dividers](https://m3.material.io/components/divider/overview) are thin lines that separate items in lists or other\ncontainers. You can implement dividers in your app using the `HorizontalDivider`\nand `VerticalDivider` composables.\n\n- [`HorizontalDivider`](/reference/kotlin/androidx/compose/material3/package-summary#HorizontalDivider(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color)): Separate items in a column.\n- [`VerticalDivider`](/reference/kotlin/androidx/compose/material3/package-summary#VerticalDivider(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color)): Separate items in a row.\n\nAPI surface\n-----------\n\nBoth components provide parameters for modifying their appearance:\n\n- `thickness`: Use this parameter to specify the thickness of the divider line.\n- `color`: Use this parameter to specify the color of the divider line.\n\n| **Note:** You can use the `modifier` parameter to control padding.\n\nHorizontal divider example\n--------------------------\n\nThe following example demonstrates an implementation of the\n`HorizontalDivider` component. It uses the `thickness` parameter to control the\nheight of the line:\n\n\n```kotlin\n@Composable\nfun HorizontalDividerExample() {\n Column(\n verticalArrangement = Arrangement.spacedBy(8.dp),\n ) {\n Text(\"First item in list\")\n HorizontalDivider(thickness = 2.dp)\n Text(\"Second item in list\")\n }\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/components/Divider.kt#L57-L66\n```\n\n\u003cbr /\u003e\n\nThis implementation renders a thin horizontal line between two text components:\n**Figure 1.** A horizontal divider separating two text components.\n\nVertical divider example\n------------------------\n\nThe following example demonstrates an implementation of the\n`VerticalDivider` component. It uses the `color` parameter to provide a custom\ncolor for the line:\n\n\n```kotlin\n@Composable\nfun VerticalDividerExample() {\n Row(\n modifier = Modifier\n .fillMaxWidth()\n .height(IntrinsicSize.Min),\n horizontalArrangement = Arrangement.SpaceEvenly\n ) {\n Text(\"First item in row\")\n VerticalDivider(color = MaterialTheme.colorScheme.secondary)\n Text(\"Second item in row\")\n }\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/components/Divider.kt#L71-L83\n```\n\n\u003cbr /\u003e\n\nThis implementation renders a thin vertical line between two text components:\n**Figure 2.** A vertical divider separating two text components.\n\nAdditional resources\n--------------------\n\n- [`HorizontalDivider`](/reference/kotlin/androidx/compose/material3/package-summary#HorizontalDivider(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color))\n- [`VerticalDivider`](/reference/kotlin/androidx/compose/material3/package-summary#VerticalDivider(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color))\n- [Material Design - Dividers](https://m3.material.io/components/divider)"]]