Tabs
octane/tabsFreeComponent
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/tabs.jsonSource
1// Base UI base tabs — TRANSCRIBED from upstream's `bases/base-ui/ui/tabs.tsx` (maintainer-supplied),2// class strings verbatim. Runs on @octanejs/base-ui's `Tabs`, which was ported for this family:3// Root / List / Tab / Panel.4//5// ONE DEPARTURE FROM THE SOURCE, FORCED BY A VERSION SKEW. Upstream writes its orientation variants6// as `data-horizontal:` / `data-vertical:` — bare attributes. The pinned @octanejs/base-ui (v1.6.0)7// converts the orientation state to `data-orientation="horizontal" | "vertical"` instead, so those8// utilities would match nothing: the root would never switch to a column, and every9// `group-data-horizontal/tabs:` and `group-data-vertical/tabs:` selector on the trigger would be10// dead. They are written as `data-[orientation=…]:` here.11//12// This is the SAME skew the slider hit, and it is not a porting mistake in either layer — shadcn's13// Base UI sources target a newer Base UI than the pin this package binds. The primitive stays14// faithful to its pin; the adaptation belongs here. When the binding moves to a release that emits15// the bare attributes, these revert to upstream's spelling.16//17// `data-active` on the trigger needs no such treatment: the pin emits it exactly as upstream's18// classes expect (verified by rendering).19//20// Octane adaptations: no `"use client"`.21import { cva, type VariantProps } from 'class-variance-authority';22import { Tabs as TabsPrimitive } from '@octanejs/base-ui/tabs';2324import { cn } from '@/lib/utils';2526type Props = { className?: string } & Record<string, unknown>;2728export interface TabsProps extends Props {29 orientation?: 'horizontal' | 'vertical';30}3132export function Tabs({ className, orientation = 'horizontal', ...props }: TabsProps) @{33 <TabsPrimitive.Root34 data-slot="tabs"35 data-orientation={orientation}36 orientation={orientation}37 className={cn('group/tabs flex gap-2 data-[orientation=horizontal]:flex-col', className)}38 {...props}39 />40}4142export const tabsListVariants = cva(43 'group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-8 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none',44 {45 variants: {46 variant: {47 default: 'bg-muted',48 line: 'gap-1 bg-transparent',49 },50 },51 defaultVariants: {52 variant: 'default',53 },54 },55);5657export interface TabsListProps extends Props {58// … truncated
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 |
