Separator

A horizontal or vertical line between pieces of content.

arene
An opinionated React design system
Components on Base UI and StyleX, distributed by copy and paste.
import * as stylex from "@stylexjs/stylex"
import { Separator } from "@/components/ui/separator"
import { VStack } from "@/components/ui/stack"
import { Text } from "@/components/ui/text"
import { leading, text, width } from "@/theme/tokens.stylex"

const styles = stylex.create({
  root: { width: "100%", maxWidth: width.sm, fontSize: text.sm, lineHeight: leading.sm },
  title: { fontWeight: 500, lineHeight: 1 },
})

export default function SeparatorDemo() {
  return (
    <VStack gap={4} xstyle={styles.root}>
      <VStack gap={1.5}>
        <div {...stylex.props(styles.title)}>arene</div>
        <Text render={<div />} tone="muted">
          An opinionated React design system
        </Text>
      </VStack>
      <Separator />
      <div>Components on Base UI and StyleX, distributed by copy and paste.</div>
    </VStack>
  )
}

Installation

pnpm dlx shadcn@latest add @arene/separator

Needs the arene setup first.

Usage

import { Separator } from "@/components/ui/separator"
<Separator />

Vertical

orientation="vertical" draws the line from top to bottom. It stretches to the height of the flex row it sits in.

Blog
Docs
Source
import * as stylex from "@stylexjs/stylex"
import { Separator } from "@/components/ui/separator"
import { HStack } from "@/components/ui/stack"
import { leading, space, text } from "@/theme/tokens.stylex"

const styles = stylex.create({
  root: { height: space.s5, fontSize: text.sm, lineHeight: leading.sm },
})

export default function SeparatorVertical() {
  return (
    <HStack gap={4} align="center" xstyle={styles.root}>
      <div>Blog</div>
      <Separator orientation="vertical" />
      <div>Docs</div>
      <Separator orientation="vertical" />
      <div>Source</div>
    </HStack>
  )
}

A vertical separator has no height of its own. Outside a flex container, or in a row aligned by anything other than stretch, give it one through xstyle.

Vertical separators divide a row of menu entries that each carry a description.

BuildsRuns and logs
MembersPeople and roles
DocsGuides and API
import { Separator } from "@/components/ui/separator"
import { HStack, VStack } from "@/components/ui/stack"
import { Text, textStyles } from "@/components/ui/text"

export default function SeparatorMenu() {
  return (
    <HStack gap={4} align="center" xstyle={textStyles.sizes.sm}>
      <VStack gap={1}>
        <Text weight="medium">Builds</Text>
        <Text size="xs" tone="muted">
          Runs and logs
        </Text>
      </VStack>
      <Separator orientation="vertical" />
      <VStack gap={1}>
        <Text weight="medium">Members</Text>
        <Text size="xs" tone="muted">
          People and roles
        </Text>
      </VStack>
      <Separator orientation="vertical" />
      <VStack gap={1}>
        <Text weight="medium">Docs</Text>
        <Text size="xs" tone="muted">
          Guides and API
        </Text>
      </VStack>
    </HStack>
  )
}

List

Horizontal separators divide the rows of a list.

Version
2.4.0
Released
May 12, 2025
License
MIT
import * as stylex from "@stylexjs/stylex"
import { Separator } from "@/components/ui/separator"
import { HStack, VStack } from "@/components/ui/stack"
import { Text } from "@/components/ui/text"
import { leading, text, width } from "@/theme/tokens.stylex"

const styles = stylex.create({
  root: { width: "100%", maxWidth: width.sm, fontSize: text.sm, lineHeight: leading.sm },
})

export default function SeparatorList() {
  return (
    <VStack gap={2} xstyle={styles.root}>
      <HStack render={<dl />} justify="between" align="center">
        <dt>Version</dt>
        <Text render={<dd />} tone="muted">
          2.4.0
        </Text>
      </HStack>
      <Separator />
      <HStack render={<dl />} justify="between" align="center">
        <dt>Released</dt>
        <Text render={<dd />} tone="muted">
          May 12, 2025
        </Text>
      </HStack>
      <Separator />
      <HStack render={<dl />} justify="between" align="center">
        <dt>License</dt>
        <Text render={<dd />} tone="muted">
          MIT
        </Text>
      </HStack>
    </VStack>
  )
}

API reference

Pass render to replace a part's element or compose it with another component.

Separator wraps the Base UI Separator and accepts its props. See the Base UI reference. It renders a <div role="separator"> with aria-orientation set from the prop.

Separator

PropTypeDefault
orientation"horizontal" | "vertical""horizontal"
xstyleStyleXStyles—
classNamestring—

separatorStyles

The style maps behind the component. Spread them onto any element.

KeyWhat it is
baseThe fill and flex-shrink: 0
orientationshorizontal and vertical: the 1px thickness and the length

Data attributes

AttributeOnEffect
data-slot="separator"the separatorTargets the rule from a parent
data-orientationthe separatorBase UI writes it from orientation