# Radio ### Install ``` javascript import Vue from 'vue'; import { RadioGroup, Radio } from 'vant'; Vue.use(RadioGroup); Vue.use(Radio); ``` ## Usage ### Basic Usage Use `v-model` to bind the name of checked radio ```html Radio 1 Radio 2 ``` ```javascript export default { data() { return { radio: '1' } } }; ``` ### Disabled ```html Radio 1 Radio 2 ``` ### Custom Color ```html Radio 1 Radio 2 ``` ### Custom Icon Use icon slot to custom icon ```html Radio 1 Radio 2 ``` ```js export default { data() { return { radio: '1', icon: { active: 'https://img.yzcdn.cn/vant/user-active.png', inactive: 'https://img.yzcdn.cn/vant/user-inactive.png' } }; } }; ``` ### Inside a Cell ```html ``` ## API ### Radio Props | Attribute | Description | Type | Default | Version | |------|------|------|------|------| | name | Radio name | *any* | - | - | | shape | Can be set to `square` | *string* | `round` | - | | disabled | Whether to disable radio | *boolean* | `false` | - | | icon-size | Icon size | *string \| number* | `20px` | - | | label-disabled | Whether to disable label click | *boolean* | `false` | - | | label-position | Can be set to `left` | *string* | `right` | - | | checked-color | Checked color | *string* | `#1989fa` | - | - | ### RadioGroup Props | Attribute | Description | Type | Default | Version | |------|------|------|------|------| | v-model | Name of checked radio | *any* | - | - | | disabled | Disable all radios | *boolean* | `false` | - | ### Radio Events | Event | Description | Parameters | |------|------|------| | click | Triggered when click radio | event: Event | ### RadioGroup Events | Event | Description | Parameters | |------|------|------| | change | Triggered when value changed | current value | ### Radio Slots | Name | Description | SlotProps | |------|------|------| | default | Custom label | - | | icon | Custom icon | checked: whether to be checked |