다음 예는 HorizontalDivider 구성요소의 구현을 보여줍니다. thickness 매개변수를 사용하여 선의 높이를 제어합니다.
@ComposablefunHorizontalDividerExample(){Column(verticalArrangement=Arrangement.spacedBy(8.dp),){Text("First item in list")HorizontalDivider(thickness=2.dp)Text("Second item in list")}}
다음 예는 VerticalDivider 구성요소의 구현을 보여줍니다. color 매개변수를 사용하여 선의 맞춤 색상을 제공합니다.
@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")}}
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["[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\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\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/5673ffc60b614daf028ee936227128eb8c4f9781/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\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/5673ffc60b614daf028ee936227128eb8c4f9781/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- [`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)"]]