Divider
Horizontal or vertical ARCUI separator with token-driven geometry and optional horizontal label content.
Divider centralizes separator geometry, theme color, and optional inline label composition so applications do not repeat ad-hoc one-pixel View styles.
Usage
import { Divider } from "react-native-arc-ui";
<Divider />;Horizontal is the default orientation, length defaults to "100%", and thickness/radius fall back to Divider tokens.
Horizontal
<Divider length="100%" thickness={1} />A horizontal Divider may include label content:
<Divider label="OR" labelPosition="center" />Logical positions are:
start | center | endLabel content
Textual ReactNode content receives ARCUI divider typography, theme color, and central font scaling.
<Divider label="Optional" />Custom non-text ReactNode content remains consumer-owned:
<Divider label={<Badge label="New" />} />Empty textual content and boolean ReactNode sentinels behave like no label and do not create empty gaps.
Vertical
<Divider orientation="vertical" length={32} />Vertical mode intentionally does not accept label or labelPosition. The public discriminated union models that invariant directly.
Geometry
<Divider
length={160}
thickness={2}
radius={1}
/>- horizontal root:
width = length, lineheight = thickness; - vertical root:
height = length, linewidth = thickness.
Invalid runtime dimensions/radius degrade safely to Divider defaults.
Theme colors
<Divider color="rgba(255,255,255,0.15)" />
<Divider
darkColor="rgba(255,255,255,0.15)"
lightColor="rgba(0,0,0,0.12)"
/>Priority:
color
-> complete darkColor + lightColor pair
-> colors.*.divider.lineThe label color remains owned by colors.*.divider.label.
Native surface
Divider supports React 19 ref-as-prop and a normal root style. Native View props such as testID, accessibility props, and layout callbacks remain available.
Testing
Stable suffixes depend on orientation/content:
divider
divider-line // unlabeled line or vertical line
divider-line-start // horizontal labeled divider
divider-line-end // horizontal labeled divider
divider-label // textual label
divider-label-content // custom ReactNode labelFor provider setup and react-native-arc-ui/testing, see Testing.
API Reference
Divider Base · variant 1
Also inherits: ViewProps
| Prop | Type | Default | Description |
|---|---|---|---|
| ref? | Ref<ComponentRef<typeof View>> | — | Ref to the Divider root layout container. |
| length? | DimensionValue | "100%" | Length along the Divider's primary axis. horizontal -> width vertical -> height |
| thickness? | number | — | Divider line thickness. Falls back to tokens.sizings.divider.thickness. |
| color? | string | — | Fixed line color for both themes. Takes precedence over darkColor/lightColor. |
| darkColor? | string | — | Theme-aware line colors. Both darkColor and lightColor must be provided for the pair to override the semantic Divider color tokens. |
| lightColor? | string | — | — |
| radius? | number | — | Line corner radius. Falls back to tokens.radius.divider. |
| style? | StyleProp<ViewStyle> | — | Style applied to the Divider root layout container. Use color/darkColor/lightColor to customize the line itself. |
| orientation? | "horizontal" | — | — |
| label? | ReactNode | — | Optional content displayed inside the Divider. Textual content receives ARCUI typography, theme transitions, and font scaling automatically. Custom ReactNode content is rendered as provided. |
| labelPosition? | TDividerLabelPosition | "center" | Label placement along the horizontal Divider. Uses logical start/end terminology so the public API does not encode physical left/right semantics. |
Divider Base · variant 2
Also inherits: ViewProps
| Prop | Type | Default | Description |
|---|---|---|---|
| ref? | Ref<ComponentRef<typeof View>> | — | Ref to the Divider root layout container. |
| length? | DimensionValue | "100%" | Length along the Divider's primary axis. horizontal -> width vertical -> height |
| thickness? | number | — | Divider line thickness. Falls back to tokens.sizings.divider.thickness. |
| color? | string | — | Fixed line color for both themes. Takes precedence over darkColor/lightColor. |
| darkColor? | string | — | Theme-aware line colors. Both darkColor and lightColor must be provided for the pair to override the semantic Divider color tokens. |
| lightColor? | string | — | — |
| radius? | number | — | Line corner radius. Falls back to tokens.radius.divider. |
| style? | StyleProp<ViewStyle> | — | Style applied to the Divider root layout container. Use color/darkColor/lightColor to customize the line itself. |
| orientation | "vertical" | required | — |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
Motion
Divider has no semantic animation state. Theme-aware line/label colors interpolate with the ARCUI theme SharedValue; geometry changes remain ordinary React Native layout.
Performance
There is no component React state or timer. Static geometry is memoized where useful and color interpolation remains UI-thread visual work.
Accessibility
The line itself is decorative and is not exposed as accessible content. A textual/custom label may carry meaning through its own rendered content. Divider does not invent a separator role or generic announcement.
Theming
Relevant token areas include:
colors.*.divider
sizings.divider
radius.divider
typography.divider
typography.maxFontSizeMultiplier