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
| Element | Description |
|---|---|
| Header | Optional heading above the radio list. |
| Children | The radio list items rendered as selectable options. |
| Label/Value | The text label and associated value for each radio item. |
Best practices #
| Guideline | Practice |
|---|---|
| Do | Keep the list short, usually two to seven options. |
| Don't | Use it when more than one option can be selected. Use CheckboxList. |
| Don't | Use a horizontal list for more than about four options. |
Examples #
Radio List — Horizontal
Size
Small, medium, and large in a row.
Radio List — Pricing tier
Plan
Each plan shows its price at the end of the row.
Radio List — With descriptions
Notification preference
Choose how you would like to be notifiedA description under each option.
Radio List — With validation
Notification preference Required
Please select a notification method
An empty required group shows an error.