Radio Group

A React radio group on Base UI with a gliding dot, a segmented control style, bordered rows, and radio cards for plan and shipping pickers.

Loading preview

Examples

Practical examples and common states for the same installable component.

Orb

Minimal radio rows for normal form choices.

examples/radio-group-orb.tsx
import { RadioGroup, RadioOption } from "@/components/wensity/radio-group";
export function RadioGroupOrb() {
return (
<RadioGroup label="Workspace visibility" defaultValue="private">
<RadioOption
value="private"
label="Private"
description="Only invited members can view this workspace."
/>
<RadioOption
value="team"
label="Team-visible"
description="Every teammate in the organization can discover it."
/>
<RadioOption
value="public"
label="Public"
description="Anyone with the link can view the overview."
/>
</RadioGroup>
);
}

Command rows

Rich rows for setup flows where descriptions and metadata matter.

examples/radio-group-command.tsx
import { IconBrandGithub, IconCloud, IconCode } from "@tabler/icons-react";
import { RadioGroup, RadioOption } from "@/components/wensity/radio-group";
export function RadioGroupCommand() {
return (
<RadioGroup label="Source provider" defaultValue="github" variant="command">
<RadioOption
value="github"
label="GitHub"
description="Import repositories and sync preview deployments."
leading={<IconBrandGithub stroke={1.75} />}
trailing="OAuth"
/>
<RadioOption
value="cli"
label="CLI upload"
description="Ship a local component package from your terminal."
leading={<IconCode stroke={1.75} />}
/>
<RadioOption
value="cloud"
label="Cloud storage"
description="Reference an existing source bundle."
leading={<IconCloud stroke={1.75} />}
/>
</RadioGroup>
);
}

Segment

Compact single-choice control for filters, toolbars, and form headers.

examples/radio-group-segment.tsx
import { RadioGroup, RadioOption } from "@/components/wensity/radio-group";
export function RadioGroupSegment() {
return (
<RadioGroup defaultValue="annual" variant="segment" orientation="horizontal">
<RadioOption value="monthly" label="Monthly" />
<RadioOption value="annual" label="Annual" />
<RadioOption value="custom" label="Custom" />
</RadioGroup>
);
}

Tiles

Selection cards for pricing, onboarding, and high-value decisions.

examples/radio-group-tiles.tsx
import {
IconBuildingSkyscraper,
IconRocket,
IconSparkles,
} from "@tabler/icons-react";
import { RadioCard, RadioGroup } from "@/components/wensity/radio-group";
export function RadioGroupTiles() {
return (
<RadioGroup defaultValue="pro" variant="tile">
<div className="grid gap-3 sm:grid-cols-3">
<RadioCard
value="free"
label="Free"
description="Explore primitives and docs."
eyebrow="$0"
leading={<IconSparkles stroke={1.75} />}
/>
<RadioCard
value="pro"
label="Pro"
description="Use source files in production."
eyebrow="$19"
leading={<IconRocket stroke={1.75} />}
/>
<RadioCard
value="team"
label="Team"
description="Seats, billing, and shared tokens."
eyebrow="Custom"
leading={<IconBuildingSkyscraper stroke={1.75} />}
/>
</div>
</RadioGroup>
);
}

Error

Validation messaging for required single-choice fields.

examples/radio-group-error.tsx
import { IconShieldLock } from "@tabler/icons-react";
import { RadioGroup, RadioOption } from "@/components/wensity/radio-group";
export function RadioGroupError() {
return (
<RadioGroup
label="Security policy"
error="Choose a policy before saving this workspace."
variant="command"
>
<RadioOption
value="standard"
label="Standard"
description="Balanced defaults for most teams."
leading={<IconShieldLock stroke={1.75} />}
/>
<RadioOption
value="strict"
label="Strict"
description="Require 2FA, SSO, and token approvals."
leading={<IconShieldLock stroke={1.75} />}
/>
</RadioGroup>
);
}

Disabled

Disabled choices stay readable without accepting input.

examples/radio-group-disabled.tsx
import { IconDeviceLaptop, IconShieldLock } from "@tabler/icons-react";
import { RadioGroup, RadioOption } from "@/components/wensity/radio-group";
export function RadioGroupDisabled() {
return (
<RadioGroup defaultValue="desktop" variant="command">
<RadioOption
value="desktop"
label="Desktop"
description="Sync settings on this device."
leading={<IconDeviceLaptop stroke={1.75} />}
/>
<RadioOption
value="managed"
label="Managed device"
description="Controlled by your organization."
disabled
leading={<IconShieldLock stroke={1.75} />}
/>
</RadioGroup>
);
}

Overview

Radio Group is a React and Tailwind CSS radio button group on Base UI, in Next.js or any React app, wrapped in a fieldset with a legend, description, and error. The default orb style glides its dot to the new choice with Framer Motion, skipped under reduced motion. The segment variant turns options into a segmented control with a sliding highlight, command shows bordered rows with a check, and RadioCard gives plan pickers a card per choice. Arrow keys move the selection. Without a name prop the group generates one, so set name for form posts.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add radio-group

Usage

Import RadioGroup from @/components/wensity/radio-group and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { RadioGroup, RadioOption } from "@/components/wensity/radio-group";
export function RadioGroupDemo() {
return (
<RadioGroup label="Deploy target" defaultValue="edge" variant="command">
<RadioOption
value="edge"
label="Edge runtime"
description="Fast global reads with isolated execution."
/>
<RadioOption
value="node"
label="Node runtime"
description="Use standard server APIs and longer tasks."
/>
</RadioGroup>
);
}

Props

PropTypeDefaultDescription
valuestring-Controlled selected value.
defaultValuestring-Initial value when the group is uncontrolled.
onValueChange(value: string, eventDetails?: unknown) => void-Called when the selection changes.
namestring-Form field name shared by every radio in the group.
labelReact.ReactNode-Group label, rendered as the fieldset legend.
descriptionReact.ReactNode-Supporting copy under the group label.
errorReact.ReactNode-Error message for the group, with invalid styling applied.
radioSize"sm" | "md" | "lg""md"Control and label size.
variant"orb" | "command" | "segment" | "tile""orb"Item treatment. tile and segment render selectable cards rather than dots.
orientation"vertical" | "horizontal""vertical"Direction the options flow in.
disabledboolean-Disables every option in the group.
  • Subscription Tier Card component preview

    Subscription Tier Card

    Pricing cards with a monthly and annual toggle, prices that spring to new values, and a highlighted plan in a brand glow.

  • AI Model Selector component preview

    AI Model Selector

    An AI model selector dropdown that scales out from its trigger and glides the selection pill to whichever model you pick.

  • Animated Tabs component preview

    Animated Tabs

    A physical stack of photo cards shuffled to the front by clipped tabs, with a tight image inset and copy in the footer.

  • Multi-Step Form Wizard component preview

    Multi-Step Form Wizard

    A multi-step form wizard whose card physically reshapes to wrap each new step as the content slides in behind it.