Skip to Content

Built by moveinready.casa  and the community

Shadcn Docs

Radix Docs

Separator

Visually or semantically separates content.

Usage

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

Components

Separator

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"The separator orientation.
decorativebooleantrueIf true, hides the separator from assistive technologies. When false, ARIA accessibility props are applied.
asChildbooleanfalseClone the first child and apply all separator props to it.
baseClassNamestring-Custom tailwind classes applied to the base separator. Takes precedence over className.
classNamestring-Additional classes merged when baseClassName is not provided.

Hooks

useSeparator

Backbone hook that returns platform-appropriate accessibility props for the separator. On web, integrates with React Aria.

Parameters:

ParameterTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"The separator orientation.
decorativebooleantrueIf true, hides the separator from assistive technologies.

Returns:

{ componentProps: React.ComponentProps<typeof View> | HTMLDivElement; }
PropertyTypeDescription
componentPropsReact.ComponentProps<typeof View> | HTMLDivElementProps to spread on the separator root element.

Accessibility

  • When decorative is true (default), the separator is visually rendered but not exposed to assistive technologies.
  • When decorative is false, the component sets role="separator", accessibilityRole="separator", and aria-orientation.
  • Web uses useSeparator to ensure correct semantics.

Styling

The separator uses Tailwind Variants:

  • Base: shrink-0 bg-border
  • Orientation variants:
    • Horizontal: h-px w-full
    • Vertical: h-full w-px

Use baseClassName to override the base classes entirely, or className to merge additional classes.

shadcn-native

Built by moveinready.casa and the community