2017-10-09 16:35:52 +03:00
|
|
|
```jsx
|
2017-05-18 21:21:33 +03:00
|
|
|
const { RadioList } = require('./radio');
|
|
|
|
const FormGroup = require('./group').default;
|
|
|
|
const Label = require('./label').default;
|
|
|
|
const Legend = require('./legend').default;
|
|
|
|
|
|
|
|
<FormGroup name='who-killed'>
|
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-09 16:35:52 +03:00
|
|
|
<Radio name="one" value='video' checked>
|
2017-05-18 21:21:33 +03:00
|
|
|
<Label>Video</Label>
|
|
|
|
</Radio>
|
2017-10-09 16:35:52 +03:00
|
|
|
<Radio name="one" value='tv'>
|
2017-05-18 21:21:33 +03:00
|
|
|
<Label>TV</Label>
|
|
|
|
</Radio>
|
2017-10-09 16:35:52 +03:00
|
|
|
<Radio disabled name="one" value='netflix'>
|
2017-05-18 21:21:33 +03:00
|
|
|
<Label>Netflix</Label>
|
|
|
|
</Radio>
|
|
|
|
</RadioList>
|
|
|
|
</FormGroup>
|
|
|
|
```
|
|
|
|
|
2017-10-09 16:35:52 +03:00
|
|
|
#### Radio input validation
|
2017-05-18 21:21:33 +03:00
|
|
|
|
2017-10-09 16:35:52 +03:00
|
|
|
```jsx
|
2017-05-18 21:21:33 +03:00
|
|
|
const { RadioList } = require('./radio');
|
|
|
|
const FormGroup = require('./group').default;
|
|
|
|
const Legend = require('./legend').default;
|
|
|
|
const FormMeta = require('./meta').default;
|
2017-10-09 16:35:52 +03:00
|
|
|
const Label = require('./label').default;
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<FormGroup name='who-killed'>
|
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-09 16:35:52 +03:00
|
|
|
<Radio name="two" success value='video'><Label>Video</Label></Radio>
|
|
|
|
<Radio name="two" success checked value='tv'>TV</Radio>
|
|
|
|
<Radio name="two" success value='netflix'>Netflix</Radio>
|
2017-05-18 21:21:33 +03:00
|
|
|
</RadioList>
|
2017-10-09 16:35:52 +03:00
|
|
|
<FormMeta left success>
|
|
|
|
You are the best !
|
2017-05-18 21:21:33 +03:00
|
|
|
</FormMeta>
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup name='who-killed'>
|
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-09 16:35:52 +03:00
|
|
|
<Radio name="three" warning checked value='video'><Label>Video</Label></Radio>
|
|
|
|
<Radio name="three" warning value='tv'>TV</Radio>
|
|
|
|
<Radio name="three" warning value='netflix'>Netflix</Radio>
|
2017-05-18 21:21:33 +03:00
|
|
|
</RadioList>
|
|
|
|
<FormMeta left warning>
|
2017-10-09 16:35:52 +03:00
|
|
|
Are you sure ?
|
2017-05-18 21:21:33 +03:00
|
|
|
</FormMeta>
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup name='who-killed'>
|
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-09 16:35:52 +03:00
|
|
|
<Radio name="four" error value='video'><Label>Video</Label></Radio>
|
|
|
|
<Radio name="four" error value='tv'>TV</Radio>
|
|
|
|
<Radio name="four" error value='netflix'>Netflix</Radio>
|
2017-05-18 21:21:33 +03:00
|
|
|
</RadioList>
|
2017-10-09 16:35:52 +03:00
|
|
|
<FormMeta error left>
|
|
|
|
You need to select one
|
|
|
|
</FormMeta>
|
2017-05-18 21:21:33 +03:00
|
|
|
</FormGroup>
|
|
|
|
</div>
|
|
|
|
```
|