Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Field examples · Toggles

Radio with Descriptions Field for React

A subscription plan fieldset of radio buttons with each price in its label.

Framework
UI library

Plans compared at a glance: each option's label carries its price, Monthly ($9.99/month), Yearly ($99.99/year) and Lifetime ($299.99). The FieldDescription under the legend points out the savings. Monthly is selected by default.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How does the group keep a single plan selected?

The three plans share one RadioGroup. defaultValue is monthly, so Monthly starts selected, and choosing another plan clears it.

Where do the prices show?

Each price is part of the option text: Monthly ($9.99/month), Yearly ($99.99/year), and Lifetime ($299.99). The values are monthly, yearly, and lifetime.

What is the Subscription Plan line?

FieldDescription on the set reads Yearly and lifetime plans offer significant savings. That sentence covers the group, and the prices stay on the options. The caption is a FieldLegend with variant set to label.

Where does each plan's text go?

Each plan is a horizontal Field with RadioGroupItem and a FieldLabel. font-normal on the label keeps the price at normal weight.

How wide is the list?

The block is capped with max-w-md. The caption, the savings sentence, and the three rows share that width.

Which keys move between the plans?

The keys are the radio group's own keys. Field does not add arrow-key behavior of its own.