Radio List

Alignment target:@astryxdesign/core v0.7.1 · RadioList

Notification preference

Usage #

RadioList picks one value. Put a RadioListItem in the default slot, or pass an options array when the rows are plain text.

Vue
<script setup lang="ts">
import { RadioList, RadioListItem } from '@astryx-vue/core/RadioList'
import { shallowRef } from 'vue'

const channel = shallowRef('')
</script>

<template>
  <RadioList v-model="channel" label="Notification preference">
    <RadioListItem label="Email" value="email" />
    <RadioListItem label="SMS" value="sms" />
  </RadioList>
</template>

The indicator is 24px by default, and 20px when size="sm". orientation="horizontal" lays the rows in a row with a 20px gap. The end slot sits on the trailing edge.

Anatomy

ElementDescription
HeaderOptional heading above the radio list.
ChildrenThe radio list items rendered as selectable options.
Label/ValueThe text label and associated value for each radio item.

Best practices #

GuidelinePractice
DoKeep the list short, usually two to seven options.
Don'tUse it when more than one option can be selected. Use CheckboxList.
Don'tUse a horizontal list for more than about four options.

Examples #

Radio List — Horizontal

Size
Open in Playground

Small, medium, and large in a row.

Radio List — Pricing tier

Plan
Open in Playground

Each plan shows its price at the end of the row.

Radio List — With descriptions

Notification preference
Choose how you would like to be notified
Open in Playground

A description under each option.

Radio List — With validation

Notification preference Required
Please select a notification method
Open in Playground

An empty required group shows an error.