# Radio ### Install ``` javascript 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 ``` ### Custom Icon Use icon slot to custom icon ```html Custom Icon ``` ```js export default { data() { checked: true, icon: { normal: '//img.yzcdn.cn/icon-normal.png', active: '//img.yzcdn.cn/icon-active.png' } } } ``` ### Inside a Cell ```html ``` ## API ### Radio Props | Attribute | Description | Type | Default | |------|------|------|------| | 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 | |------|------|------|------| | v-model | Name of checked radio | `any` | - | | disabled | Diable 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 | slot-scope | |------|------|------| | default | Custom label | - | | icon | Custom icon | checked: whether to be checked |