Separator
octane/separatorFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/separator.jsonSource
1// Base UI base separator — runs on the @octanejs/base-ui `Separator` primitive.2//3// THE CLASS STRING IS DELIBERATELY THE ARIA BASE'S, NOT THE RADIX BASE'S, and this is the one4// family where copying the wrong base is a real bug rather than a cosmetic risk. The5// orientation-conditional utilities must key off the attribute the primitive actually emits:6//7// Radix sets `data-orientation` -> `data-horizontal:h-px`8// RAC sets `aria-orientation` -> `aria-[orientation=horizontal]:h-px`9// Base UI sets `aria-orientation` -> same as RAC (verified in the primitive: it renders10// `role="separator"` plus `aria-orientation={orientation}`)11//12// Taking the Radix string here would produce a separator with no height or width at all, and13// nothing in a class-string comparison would flag it. Upstream's own bases diverge here for14// exactly this reason. The non-conditional utilities stay in step with the other bases.15import { Separator as SeparatorPrimitive } from '@octanejs/base-ui/separator';1617import { cn } from '@/lib/utils';1819export interface SeparatorProps extends Record<string, unknown> {20 className?: string;21 orientation?: 'horizontal' | 'vertical';22}2324export function Separator({ className, orientation = 'horizontal', ...props }: SeparatorProps) @{25 <SeparatorPrimitive26 data-slot="separator"27 orientation={orientation}28 className={cn(29 'block shrink-0 border-0 bg-border aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=vertical]:w-px aria-[orientation=vertical]:self-stretch [:is(hr)]:h-px [:is(hr)]:w-full',30 className,31 )}32 {...props}33 />34}
What it pulls in
npm packages
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | octane | Components | Free | no deps | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps |
