Radio group
blok/radio-groupFreeComponent
A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.
Install it
npx shadcn@latest add https://blok.sitecore.com/r/radio-group.jsonSource
1"use client";23import { Icon } from "@/lib/icon";4import { mdiCircle } from "@mdi/js";5import { RadioGroup as RadioGroupPrimitive } from "radix-ui";6import type * as React from "react";78import { cn } from "@/lib/utils";910function RadioGroup({11 className,12 ...props13}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {14 return (15 <RadioGroupPrimitive.Root16 data-slot="radio-group"17 className={cn("grid gap-3", className)}18 {...props}19 />20 );21}2223function RadioGroupItem({24 className,25 ...props26}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {27 return (28 <RadioGroupPrimitive.Item29 data-slot="radio-group-item"30 className={cn(31 "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border transition-[color] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",32 className,33 )}34 aria-label={35 props["aria-label"] || props["aria-labelledby"]36 ? undefined37 : "Radio button"38 }39 {...props}40 >41 <RadioGroupPrimitive.Indicator42 data-slot="radio-group-indicator"43 className="relative flex items-center justify-center"44 >45 <Icon path={mdiCircle} size={0.8} />46 </RadioGroupPrimitive.Indicator>47 </RadioGroupPrimitive.Item>48 );49}5051export { RadioGroup, RadioGroupItem };
What it pulls in
npm packages
Other registry items
Files it writes
More from blok
All 72 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blok | Components | Free | 2 deps · 2 files | |
| Action baraction-bar | blok | Components | Free | 1 dep · 2 files | |
| Alertalert | blok | Components | Free | 2 deps · 2 files | |
| Alert dialogalert-dialog | blok | Components | Free | 2 deps | |
| Aspect ratioaspect-ratio | blok | Components | Free | 1 dep | |
| Avataravatar | blok | Components | Free | 1 dep | |
| Badgebadge | blok | Components | Free | 2 deps | |
| All componentsblok-components | blok | Components | Free | no deps |
