Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
    • Checkbox
    • ChoiceGroup
    • CurrencyInput
    • DateInput
    • FileInputZone
    • Filters
    • Form
    • MaskedTextInput
    • PasswordInput
    • Pill
    • Pill
    • Radio
    • SearchInput
    • SegmentedSlider
    • Select
    • Switch
    • TextArea
    • TextInput
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Forms & inputs
  • ChoiceGroup

ChoiceGroup

A list of options a member picks from before moving on, as radios, checkboxes or links. Use when the choice fills the screen rather than sitting in a form.

Health
Component health
Source
View on Github
Storybook
View in Storybook
Playground
No Example
Accessibility

compliant

Platform
Universal
  • Overview
  • Props
When to use ChoiceGroup

Use ChoiceGroup when users need to choose between multiple items before navigating to another screen or completing an action. Common use cases include:

  • Selecting a care act from a list before viewing details
  • Choosing a care type before entering the claim reimbursement flow
  • Picking a plan or option before proceeding to checkout
When NOT to use ChoiceGroup

Don't use ChoiceGroup for a single button or link. Use a ListItem or HighlightButton instead.

Quickstart​

Single selection

Selected: none

Multiple selection

Selected: none

Action list

Action 2

Props​

Variants​

Visual style variant:

Rich Variant​

"rich": Detailed UI with icons, descriptions, and custom children. Use for detailed option lists.

Selected: none

Simple Variant​

"simple": Minimal design with label-only items. Use for basic selection needs.

Selected: none

Decor Types​

The decor prop allows adding visual elements to items. Supported types:

  • icon: Display an icon (e.g., { type: "icon", visual: "Flag" })
  • emoji: Display an emoji (e.g., { type: "emoji", visual: "👋" })
  • avatar: Display an avatar with imageURL or image (e.g., { type: "avatar", imageURL: "..." })
  • blobby: Display a blobby illustration (e.g., { type: "blobby", visual: "blobby", color: "indigo" })

Selected: none

Type​

Behavior type:

  • "single": Radio buttons - only one option can be selected at a time.
  • "multiple": Checkboxes - multiple options can be selected simultaneously.
  • "action": Button or link actions (non-selection). Items require variant="button" or variant="link".

Single​

Selected: none

Multiple​

Selected: none

Action​

Examples​

Preselected Values​

Initialize state with a value to preselect options:

Selected: option2

Disabled Items​

Individual items can be disabled:

Selected: option1

Option 2 (disabled)

This option is disabled

Custom Gap​

Customize spacing between items using the gap prop:

Selected: none

Mixed Buttons and Links​

Mix button and link items in action type:

Link Action

This is a link action

Accessibility​

ChoiceGroup requires either an aria-label or aria-labelledby prop for type="single" and type="multiple". These props are not required for type="action" since action items are individual buttons/links that don't form a selection group.

Playground​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

ChoiceGroup props

NameTypeDefault ValueDescriptionUsage count
aria-labelstringundefinedAccessibility label for the group
aria-labelledbystringundefinedID of element that labels the group
children*ReactNodeChild ChoiceGroup.Item components
defaultValuestringstring[]undefinedSelected item value (uncontrolled) Array of selected item values (uncontrolled)
gapChoiceGroupGapundefinedGap between items (defaults to $px12)
onChange
2 possibilities((value: string) => void) | ((value: string[]) => void)undefined
Callback when selection changes
sxPositionPropsundefinedPositioning styles for the group
type*"action""multiple""single"Selection type: "single" for radio buttons Selection type: "multiple" for checkboxes Action type: "action" for button/link actions (non-selection)
valuestringstring[]undefinedSelected item value (controlled) Array of selected item values (controlled)
variant*"rich""simple"Visual variant: "rich" for detailed UI, "simple" for minimal UI

ChoiceGroup.Item props

NameTypeDefault ValueDescriptionUsage count
aria-hiddenbooleanundefined

Undocumented props

NameTypeDefault ValueDescriptionUsage count
decorany
decorAlignmentany
descriptionany
disabledany
hideCaretany
hrefany
labelany
onPressany
progressany
sxany
testIDany
valueany
variantany

Style API​

Use sx for one-off adjustments. It accepts these style keys:

alignSelfanimationaspectRatiobottomcursordisplayendflexflexBasisflexGrowflexShrinkheightinsetinsetInlineinsetInlineEndinsetInlineStartleftmarginmarginBottommarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginLeftmarginRightmarginTopmarginVerticalmatrixmaxHeightmaxWidthminHeightminWidthopacityperspectivepositionrightrotaterotateXrotateYrotateZscalescaleXscaleYskewXskewYstarttoptransformtransformOriginwidthxyzIndex

Each can be overridden per breakpoint with:

$lg$ltLg$ltMd$ltSm$ltVs$ltXl$ltXxl$md$sm$vs$xl$xs$xxl
Edit this page
Previous
Checkbox
Next
CurrencyInput
  • Quickstart
  • Props
    • Variants
    • Rich Variant
    • Simple Variant
    • Decor Types
    • Type
  • Examples
    • Preselected Values
    • Disabled Items
    • Custom Gap
    • Mixed Buttons and Links
  • Accessibility
  • Playground