Separator

A one-pixel line dividing content, horizontal or vertical.

Source
$npx @dinachi/cli@latest add separator

Dinachi UI

An accessible component library.

Docs
Source
Blog
orientation
links

Usage

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

export function Section() {
  return (
    <div>
      <p>Account</p>
      <Separator className="my-4" />
      <p>Billing</p>
    </div>
  )
}

Examples

Dinachi UI

An accessible component library.

Docs
Source
Blog
Divides a heading from a row of links.
import { Separator } from '@/components/ui/separator';

export function Example() {
  return (
    <div className="w-full max-w-sm">
      <div className="space-y-1">
        <h4 className="text-sm font-medium">Dinachi UI</h4>
        <p className="text-sm text-muted-foreground">
          An accessible component library.
        </p>
      </div>
      <Separator className="my-4" />
      <div className="flex h-5 items-center space-x-4 text-sm">
        <div>Docs</div>
        <Separator orientation="vertical" />
        <div>Source</div>
        <Separator orientation="vertical" />
        <div>Blog</div>
      </div>
    </div>
  );
}

Notes

Vertical height

A vertical separator is h-full. Give the row a height, as in <div className="flex h-5 items-center">, or the line collapses.

Decorative lines

Separator always has the separator role. For a purely visual line, use a styled div so screen readers skip it.

API

orientation"horizontal" | "vertical" = "horizontal"
Horizontal fills the width; vertical fills the height.
renderReactElement
Swap the element, keep the behaviour.

Accessibility

  • Renders with the separator role and aria-orientation set from orientation.