Meridianby Commenda
Components

Radio

One choice from a short set.

One choice from a short set: 16 circles with 14 labels built in, and Radio card for choices that need a title and a description. On the site it asks things like company size on a demo form or the plan someone wants to hear about.

Company size
1 to 50 employees51 to 500 employeesMore than 500 employees

Usage

Example.tsx
import { RadioGroup } from "@commenda/meridian/ui/radio";

<RadioGroup
  label="Company size"
  options={[
    { value: "1-50", label: "1 to 50 employees" },
    { value: "51-500", label: "51 to 500 employees" },
  ]}
  onValueChange={setSize}
/>;

A group

Stacked, 8 apart, with one chosen. Two to five options; more is a Select.

Company size
1 to 50 employees51 to 500 employeesMore than 500 employees

With descriptions

A line under each label when the options need explaining.

What would you like?
Book a demoA 30-minute call with a product specialist.Talk to a tax expertQuestions about your filings before you buy.

States

The same states as Checkbox.

Billing
AnnualMonthlyQuarterlyNot offered yet

Hover and Tab to see hover and focus.

Radio card

For bigger choices that need a title and a description, like a plan or a product. The whole card is the click target. When several can be chosen, use a Checkbox card.

Plan
StarterFor companies registered in a few states.GrowthFor companies selling across the US.EnterpriseFor groups with entities in many countries.

Anatomy

Circle 16, 1px border soft-pearl 400. Chosen fills blue 700 with a 6 white dot. The label is 14 and sits 8 to the right, the description 2 below. Radio card: 1px border, radius 8, padding 16, control and text 12 apart.

API reference

PropTypeDescription
labelRequiredstringFrom Pathfinder.
optionsRequiredreadonly RadioOption[]From Pathfinder.
styleCSSProperties | ((state: RadioGroupState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.
formstringIdentifies the form that owns the radio inputs. Useful when the radio group is rendered outside the form.
disabledbooleanWhether the component should ignore user interaction.
namestringIdentifies the field when a form is submitted.
readOnlybooleanWhether the user should be unable to select a different radio button in the group.
requiredbooleanWhether the user must choose a value before submitting a form.
inputRef((instance: HTMLInputElement | null) => void | (() => VoidOrUndefinedOnly) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLInputElement | null>A ref to access the hidden input element.
hideLabelbooleanFrom Pathfinder.
descriptionstringFrom Pathfinder.
variant"default" | "card"From Pathfinder.
orientation"vertical" | "horizontal"From Pathfinder.
classNamestringFrom Pathfinder.
valueConditionalstringFrom Pathfinder.
defaultValuestringFrom Pathfinder.
onValueChangeConditional(value: string) => voidFrom Pathfinder.

Best practices

  • Use Radio for one choice from two to five options that should all stay visible. More than five, or when space is tight, use a Select.
  • Start with one option chosen when there is a sensible default. Leave the group empty only when choosing is the point, as on a HubSpot form where the answer qualifies the lead.
  • Order options by size or time, not alphabetically by default.
  • Use Radio card when each option needs a title and a description. Keep cards in a row the same height.
  • For a single on or off choice, use a Checkbox or a Switch, never one radio.
  • Source: Pathfinder Radio. Meridian sets labels in 14 and descriptions in 14.

On this page