UX4G Logo
Components

Divider

Visual separator lines supporting Horizontal & Vertical orientations, Solid/Dashed/Dotted stroke styles, indents, and center label partitions

The UX4G Divider suite provides clean visual separation between layout sections, lists, form groups, and alternative authentication options:

  1. Horizontal Divider: Standard full-width or indented horizontal separator supporting Solid, Dashed, and Dotted stroke styles.
  2. Vertical Divider: Vertical partition bar for separating items inside row containers and action toolbars.
  3. Label Divider: Centered text or badge separator (e.g. "OR" / "SECTION") with symmetric splitting lines and configurable spacing.

Import from com.ux4g.designsystemv1.components.Ux4gDivider.


Interactive Previews

1. Horizontal Divider (Ux4gDividerOrientation.Horizontal)

Ux4gDivider - Horizontal Styles & IndentsJetpack Compose
UX4G Horizontal Divider Preview

2. Vertical Divider (Ux4gDividerOrientation.Vertical)

Ux4gDivider - Vertical OrientationJetpack Compose
UX4G Vertical Divider Preview

3. Label Divider (Partition with Center Text)

Ux4gDivider - Labeled PartitionJetpack Compose
UX4G Label Divider Preview

Kotlin Usage

Divider Showcase Example
import androidx.compose.foundation.layout.*
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.Ux4gDivider
import com.ux4g.designsystemv1.components.Ux4gDividerOrientation
import com.ux4g.designsystemv1.components.Ux4gDividerStyle
import com.ux4g.designsystemv1.foundation.Ux4gColors
import com.ux4g.designsystemv1.foundation.defaultTypography

@Composable
fun DividerShowcaseScreen() {
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .padding(16.dp),
        verticalArrangement = Arrangement.spacedBy(20.dp)
    ) {
        // 1. Standard Solid Divider
        Text("Standard Divider", style = defaultTypography.hS_strong)
        Ux4gDivider()

        // 2. Labeled "OR" Separator
        Ux4gDivider(
            label = {
                Text("OR CONTINUE WITH", style = defaultTypography.lS_strong, color = Ux4gColors.neutral600)
            }
        )

        // 3. Vertical Separator Row
        Text("Vertical Partition", style = defaultTypography.hS_strong)
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .height(40.dp),
            horizontalArrangement = Arrangement.spacedBy(16.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text("Citizen Login", style = defaultTypography.bM_default)
            Ux4gDivider(orientation = Ux4gDividerOrientation.Vertical)
            Text("Officer Portal", style = defaultTypography.bM_default)
            Ux4gDivider(orientation = Ux4gDividerOrientation.Vertical)
            Text("Admin Console", style = defaultTypography.bM_default)
        }
    }
}

Parameters

Ux4gDivider Props

PropTypeDescriptionDefault
modifierModifierCompose layout modifier.Modifier
orientationUx4gDividerOrientationLine orientation: Horizontal or Vertical.Ux4gDividerOrientation.Horizontal
colorColorStroke color of the divider line.Ux4gColors.neutral900.copy(alpha = 0.2f)
thicknessDpThickness height (horizontal) or width (vertical) of the stroke.1.dp
styleUx4gDividerStyleVisual stroke style: Solid, Dashed, Dotted.Ux4gDividerStyle.Solid
startIndentDpInset padding before the start of the divider line.0.dp
endIndentDpInset padding after the end of the divider line.0.dp
label(@Composable () -> Unit)?Optional composable centered between symmetric partition lines.null
labelSpacingDpSpacing gap between the partition lines and the centered label.8.dp
widthDp?Optional fixed width constraint override.null
heightDp?Optional fixed height constraint override.null

Ux4gDividerOrientation Enum

ValueDescription
HorizontalFull-width horizontal divider dividing vertical content blocks.
VerticalVertical partition dividing horizontally aligned elements in a Row.

Ux4gDividerStyle Enum

ValueDash PatternDescription
SolidContinuousStandard solid straight separator line.
Dashed12.dp line, 8.dp gapElongated dashed boundary line.
Dotted4.dp dot, 4.dp gapCompact dotted boundary line.

On this page