Radio Group

Radio group for single-choice selection with row or column layout, right-aligned indicators, rich item content, and card-style options.

import { RadioGroup, RadioGroupItem } from "@plexui/vue/components/RadioGroup";

On Phone, put the options in the rows of a FieldGroup inside the RadioGroup: each Field row names an option, and its RadioGroupItem without content is the checkmark at the end of the row, as in an iOS settings list. The group title names the choice. Direction, orientation, cards and the alignment check are desktop layouts, so those examples are desktop only.

Examples

Overview

Notification frequency

With Checkbox

direction
description
Choose how you'd like to be notified.
Select the topics you want to follow.

Descriptions

Choose how you'd like to be notified.

Direction

direction

Orientation

orientation

Group disabled

Video quality

Item disabled

Delivery method

With description

Spacing

Standard spacing for most use cases.
More space between elements.
Minimal spacing for dense layouts.

With Field

Notification method

Choose how you want to receive notifications.

With Field error

Subscription plan

Select a plan to continue.

Choice card

orientation

Card selection



Grouped sections

Preferences

Visibility

Control who can see project resources.

Default view

What opens first in a project.

API

RadioGroup (root)

PropTypeDefaultDescription
valuestring—Selected value. Bind with v-model:value; leave unset for an uncontrolled group
default-valuestring—Initial selected value (uncontrolled)
direction"col" | "row""row"Item flow direction
disabledbooleanfalseDisable the whole group
namestring—Name of the hidden radio inputs submitted with the owning form
requiredbooleanfalseMarks the group and every hidden radio input as required
aria-labelstring—Accessible group label
classstring—Extra classes on the group element
default slotVNode[]—RadioGroupItem children
@update:value(value: string) => void—Emitted when the selected option changes; powers v-model:value
@change(value: string) => void—Emitted with update:value, named after the React onChange prop

RadioGroupItem

PropTypeDefaultDescription
valuestring—Item value
disabledbooleanfalseDisable this item only
requiredboolean—Marks this item as required
blockbooleanfalseStretch item to fill available width
orientation"left" | "right""left"Position of the radio indicator relative to the label
descriptionstring—Second line below the option's label, linked via aria-describedby (or the description slot)
classstring—Extra classes on the label element
default slotVNode[]—Label content (text or rich content)

Other attributes on RadioGroup, such as the id, aria-describedby and aria-invalid a Field passes, land on the group element. Other attributes on RadioGroupItem land on its wrapper <div>. The arrow keys move focus and check the focused option; Home and End move focus only (roving focus from Reka UI). Inside a <form>, hidden native radios mirror the selection so the value is submitted with the form.

Styling

Radio Group reads these component tokens. Override them at any scope to restyle it:

  • --radio-group-col-gap: col gap (default spacing(2.5))
  • --radio-group-indicator-background-color: indicator background color (default var(--color-background-primary-solid))
  • --radio-group-indicator-border-color: indicator border color (default var(--color-border-primary-outline))
  • --radio-group-indicator-border-color-hover: indicator border color hover (default var(--alpha-25))
  • --radio-group-indicator-hole-background-color: indicator hole background color (default var(--color-text-primary-solid))
  • --radio-group-indicator-hole-size: indicator hole size (default 0.375rem)
  • --radio-group-indicator-size: indicator size (default var(--font-text-lg-size))
  • --radio-group-item-font-size: item font size (default var(--font-text-sm-size))
  • --radio-group-item-gap: item gap (default spacing(1.5))
  • --radio-group-item-line-height: item line height (default var(--font-text-sm-line-height))
  • --radio-group-row-gap: row gap (default spacing(5))