Item
octane/itemFreeComponent
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/item.jsonSource
1// Base UI base item — class strings from the maintainer-supplied radix source, verbatim. Ten of the2// eleven parts are plain host elements, and the eleventh (`ItemSeparator`) delegates to this base's3// own Separator, so it picks up Base UI's `aria-orientation` dialect automatically.4//5// NO DIALECT RISK IN THE VARIANTS, which is worth stating because they look like the ones that6// caught toggle and slider: `data-[size=…]` and `data-[variant=…]` here read attributes THIS7// component writes itself, not state emitted by a primitive. Nothing underneath emits anything.8//9// `Item` SHIPS WITHOUT `asChild`, the same call as badge and breadcrumb in this base. Radix swaps in10// `Slot`; React Aria takes a `render` function; Base UI has no Slot, and item has no primitive to11// borrow a `render` prop from, so nothing here settles the spelling upstream uses. Adding it later12// is additive; shipping the wrong shape is breaking. A consumer needing a different element can13// apply `itemVariants({ variant, size })` directly, which is what the class export is for.14import { cva, type VariantProps } from 'class-variance-authority';1516import { cn } from '@/lib/utils';17import { Separator } from '@/components/ui/separator';1819type DivProps = { className?: string } & Record<string, unknown>;2021export function ItemGroup({ className, ...props }: DivProps) @{22 <div23 role="list"24 data-slot="item-group"25 className={cn(26 'group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2',27 className,28 )}29 {...props}30 />31}3233export function ItemSeparator({ className, ...props }: DivProps) @{34 <Separator35 data-slot="item-separator"36 orientation="horizontal"37 className={cn('my-2', className)}38 {...props}39 />40}4142export const itemVariants = cva(43 'group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted',44 {45 variants: {46 variant: {47 default: 'border-transparent',48 outline: 'border-border',49 muted: 'border-transparent bg-muted/50',50 },51 size: {52 default: 'gap-2.5 px-3 py-2.5',53 sm: 'gap-2.5 px-3 py-2.5',54 xs: 'gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0',55 },56 },57 defaultVariants: {58 variant: 'default',59 size: 'default',60 },61 },62);6364export interface ItemProps extends Record<string, unknown> {65 className?: string;66// … 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 |
