Radio Group
octane/radio-groupFreeComponent
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/radio-group.jsonSource
1// Base UI base radio-group — runs on @octanejs/base-ui's `RadioGroup` plus `Radio`.2//3// PART MAPPING DIFFERS FROM RADIX. Radix nests everything under one namespace4// (RadioGroup.Root / .Item / .Indicator); Base UI splits the group from the item, so the item5// is `Radio.Root` from a separate subpath and the indicator is `Radio.Indicator`. The exported6// component names and every data-slot stay as shadcn defines them, so consumers see no7// difference — this is wiring, not API.8//9// `disabled:` becomes `data-disabled:` for the same reason as checkbox and switch: Radio.Root10// renders a `<span role="radio">`, which is never `:disabled`, so the pseudo-class variant could11// never match. The primitive publishes `data-disabled` instead.12//13// THE ROOT MUST CARRY ITS OWN DISPLAY, and this is the second consequence of that same `<span>`.14// Radix's radio root is a `<button>`, which is `display: inline-block` by default, so its class15// string never needed one and `size-4` just worked. A bare `<span>` is `display: inline`, where16// width and height are IGNORED — the box collapses and only `border` paints, rendering the control17// as a thin vertical bar beside its label rather than a circle. The React Aria base hit the same18// thing (its root is not a button either) and carries `relative flex` for it; this base copied the19// radix string and lost it. Hence `relative flex … items-center justify-center` here.20//21// The indicator is `size-full` rather than `relative` so the dot, which positions itself with22// `absolute … -translate-1/2`, anchors to the ROOT's 16px box — matching the React Aria base. Left23// `relative`, it would anchor to a zero-sized flex item and sit off-centre.24//25// UNVERIFIED PROVENANCE: the non-conditional utilities come from this package's radix base26// rather than upstream's Base UI source.27import { RadioGroup as RadioGroupPrimitive } from '@octanejs/base-ui/radio-group';28import { Radio as RadioPrimitive } from '@octanejs/base-ui/radio';29import { CircleIcon } from '@octanejs/lucide';3031import { cn } from '@/lib/utils';3233type Props = { className?: string } & Record<string, unknown>;3435// Base UI's Radio.Root requires `value` (Radix infers it from the item), so the item's props36// type demands it. shadcn usage always passes one, so this tightens the type without changing37// the surface.38type ItemProps = { className?: string; value: any } & Record<string, unknown>;3940export function RadioGroup({ className, ...props }: Props) @{41// … 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 |
