mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
99 lines
1.2 KiB
Markdown
99 lines
1.2 KiB
Markdown
---
|
|
description: Display a radio field.
|
|
links:
|
|
- label: GitHub
|
|
icon: i-simple-icons-github
|
|
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Radio.vue
|
|
---
|
|
|
|
## Usage
|
|
|
|
Use a `v-model` to make the Radio reactive.
|
|
|
|
:component-example{component="radio-example"}
|
|
|
|
### Label
|
|
|
|
Use the `label` prop to display a label on the right.
|
|
|
|
::component-card
|
|
---
|
|
props:
|
|
label: 'Label'
|
|
---
|
|
::
|
|
|
|
### Style
|
|
|
|
Use the `color` prop to change the style of the Radio.
|
|
|
|
::component-card
|
|
---
|
|
baseProps:
|
|
label: 'Label'
|
|
props:
|
|
color: 'primary'
|
|
---
|
|
::
|
|
|
|
### Required
|
|
|
|
Use the `required` prop to display a red star next to the label.
|
|
|
|
::component-card
|
|
---
|
|
props:
|
|
label: 'Label'
|
|
required: true
|
|
---
|
|
::
|
|
|
|
### Help
|
|
|
|
Use the `help` prop to display some text under the Radio.
|
|
|
|
::component-card
|
|
---
|
|
props:
|
|
label: 'Label'
|
|
help: 'Please choose one'
|
|
---
|
|
::
|
|
|
|
### Disabled
|
|
|
|
Use the `disabled` prop to disable the Radio.
|
|
|
|
::component-card
|
|
---
|
|
baseProps:
|
|
label: 'Label'
|
|
props:
|
|
disabled: true
|
|
---
|
|
::
|
|
|
|
## Slots
|
|
|
|
### `label`
|
|
|
|
Use the `#label` slot to override the content of the label.
|
|
|
|
::component-card
|
|
---
|
|
slots:
|
|
label: <span class="italic">Label</span>
|
|
---
|
|
|
|
#label
|
|
[Label]{.italic}
|
|
::
|
|
|
|
## Props
|
|
|
|
:component-props
|
|
|
|
## Preset
|
|
|
|
:component-preset
|