mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
1.5 KiB
1.5 KiB
github, description
| github | description |
|---|---|
| true | Display a radio field. |
Usage
Use a v-model to make the Radio reactive.
::component-example #default :radio-example
#code
<script setup>
const methods = [{
name: 'email',
value: 'email',
label: 'Email'
}, {
name: 'sms',
value: 'sms',
label: 'Phone (SMS)'
}, {
name: 'push',
value: 'push',
label: 'Push notification'
}]
const selected = ref('sms')
</script>
<template>
<URadio v-for="method of methods" :key="method.name" v-model="selected" v-bind="method" />
</template>
::
Label
Use the label prop to display a label on the right.
::component-card
baseProps: name: 'radio1' props: label: 'Label'
::
Style :u-badge
Use the color prop to change the style of the Radio.
::component-card
baseProps: name: 'radio2' label: 'Label' props: color: 'primary'
::
Required
Use the required prop to display a red star next to the label.
::component-card
baseProps: name: 'radio3' props: label: 'Label' required: true
::
Help
Use the help prop to display some text under the Radio.
::component-card
baseProps: name: 'radio4' props: label: 'Label' help: 'Please choose one'
::
Disabled
Use the disabled prop to disable the Radio.
::component-card
baseProps: name: 'radio5' value: true props: disabled: true
::
Props
:component-props
Preset
:component-preset