Choicebox

Large selectable cards for one or many choices.

Base UI RadioBase UI Checkbox groupSource

Single choice

Use this for one choice, such as a plan. The user selects one item.

Selected: Starter

Multiple choice

Use multiple when the user can select more than one item, such as products. Set multiple on Choicebox.Group.

Selected: Product analytics

Disabled item

An unavailable item has a dashed border and a hatched fill.

Usage

These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.

  • Choose the input from the number of options and what the user picks.
    ComponentUse it for
    RadioOne choice from 2 or 3 options that stay visible.
    SelectOne choice from 4 to about 10 options, or fewer options when space is tight.
    ComboboxOne or more choices from a long list, with typing to filter.
    AutocompleteFree text, with suggestions that the user can ignore.
    ChoiceboxA choice where each option needs a description, such as a plan.
    CheckboxAn on or off value in a form that the user submits.
    SwitchA setting that applies at once.
  • Name the group with aria-label or aria-labelledby.
  • The whole card is a label. Do not put links or buttons in an item.

API

Choicebox is a site component. Its parts accept standard HTML props unless listed below.

Choicebox.Group

PropTypeDefaultDescription
multiplebooleanfalseAllows more than one selected item.
valuestring | string[]–Controls the selection. Use an array when multiple is true.
defaultValuestring | string[]–Sets the initial selection.
onValueChange(value, eventDetails) => void–Receives the value and Base UI event details.

Choicebox.Item

PropTypeDefaultDescription
valuestring–Identifies the item in its group.
disabledbooleanfalsePrevents selection of the item.