For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Separator

A visual divider between content sections.

WebNative
Frakment
frakment
Primitives for AI interfaces
A set of beautifully designed components you can customize, extend, and build on —.
separator.tsx
"use client";

import type * as React from "react";

import { cn } from "@/lib/utils";

export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
  decorative?: boolean;
  orientation?: "horizontal" | "vertical";
}

function Separator({
  className,
  orientation = "horizontal",
  decorative = true,
  ...props
}: SeparatorProps) {
  return (
    <div
      aria-orientation={decorative ? undefined : orientation}
      className={cn(
        "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
        className
      )}
      data-orientation={orientation}
      data-slot="separator"
      role={decorative ? "none" : "separator"}
      {...props}
    />
  );
}

export { Separator };

A div-based divider. Horizontal by default, vertical with orientation="vertical". When decorative is true (the default) it renders with role="none". Set decorative={false} when the divider carries structural meaning and should be announced to assistive tech.

Installation

Usage

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

Vertical

Docs
Source
Design
separator-vertical.tsx
import { Separator } from "@/components/ui/separator";

export function SeparatorVertical() {
  return (
    <div className="flex h-5 items-center gap-4 text-sm">
      <span>Docs</span>
      <Separator orientation="vertical" />
      <span>Source</span>
      <Separator orientation="vertical" />
      <span>Design</span>
    </div>
  );
}

Pass orientation="vertical". The divider fills its parent height and sets width to 1px. Use it inside a flex container with a fixed height.

tsx
<div className="flex h-5 items-center gap-4 text-sm">
  <span>Docs</span>
  <Separator orientation="vertical" />
  <span>Source</span>
</div>

Semantic

Section one

Section two

separator-decorative.tsx
import { Separator } from "@/components/ui/separator";

export function SeparatorDecorative() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-4 text-sm">
      <p>Section one</p>
      <Separator decorative={false} />
      <p>Section two</p>
    </div>
  );
}

decorative={false} renders role="separator" with aria-orientation. Use it when the divider communicates structure that a screen reader should announce. Default true hides the divider from the accessibility tree.

tsx
<Separator decorative={false} />;

API Reference

Separator

PropTypeDefaultDescription
orientation
horizontalvertical
horizontalDivider direction.
decorativebooleantrueWhen true, renders role=none and hides from assistive tech. When false, role=separator with aria-orientation.
classNamestring—Additional CSS classes merged with cn().

Accessibility

  • Default decorative={true} renders role="none", so screen readers skip the divider.
  • decorative={false} renders role="separator" and aria-orientation so the divider becomes part of the document structure.
  • Do not attach aria-label to a decorative separator. It is invisible to assistive tech by design.

Best Practices

  • Use decorative by default. Only opt into decorative={false} when the divider encodes structural meaning.
  • Prefer spacing over separators. Gap or padding on the parent often reads better than a hard line.
  • Keep vertical separators short. They work best inside inline rows (navigation, breadcrumbs, meta info).
  • Button Group: uses Separator between buttons
  • Item: list item layout with optional separator
  • Theming: customize the border token