2017-10-09 16:35:52 +03:00
|
|
|
```jsx
|
2017-10-31 12:03:44 +02:00
|
|
|
const React = require('react');
|
|
|
|
const { default: Radio, RadioList } = require('./radio');
|
|
|
|
const { default: FormGroup } = require('./group');
|
|
|
|
const { default: Label } = require('./label');
|
|
|
|
const { default: Legend } = require('./legend');
|
2017-05-18 21:21:33 +03:00
|
|
|
|
2017-10-12 21:15:51 +03:00
|
|
|
<FormGroup name="who-killed">
|
2017-05-18 21:21:33 +03:00
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-12 21:15:51 +03:00
|
|
|
<Radio name="one" value="video" checked>
|
2017-05-18 21:21:33 +03:00
|
|
|
<Label>Video</Label>
|
|
|
|
</Radio>
|
2017-10-12 21:15:51 +03:00
|
|
|
<Radio name="one" value="tv">
|
2017-05-18 21:21:33 +03:00
|
|
|
<Label>TV</Label>
|
|
|
|
</Radio>
|
2017-10-12 21:15:51 +03:00
|
|
|
<Radio disabled name="one" value="netflix">
|
2017-05-18 21:21:33 +03:00
|
|
|
<Label>Netflix</Label>
|
|
|
|
</Radio>
|
|
|
|
</RadioList>
|
2017-10-12 21:15:51 +03:00
|
|
|
</FormGroup>;
|
2017-05-18 21:21:33 +03:00
|
|
|
```
|
|
|
|
|
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-10-31 12:03:44 +02:00
|
|
|
const React = require('react');
|
|
|
|
const { default: Radio, RadioList } = require('./radio');
|
|
|
|
const { default: FormGroup } = require('./group');
|
|
|
|
const { default: Legend } = require('./legend');
|
|
|
|
const { default: FormMeta } = require('./meta');
|
|
|
|
const { default: Label } = require('./label');
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
|
|
<div>
|
2017-10-12 21:15:51 +03:00
|
|
|
<FormGroup name="who-killed">
|
2017-05-18 21:21:33 +03:00
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-12 21:15:51 +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>
|
2017-10-12 21:15:51 +03:00
|
|
|
<FormGroup name="who-killed">
|
2017-05-18 21:21:33 +03:00
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-12 21:15:51 +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>
|
2017-10-12 21:15:51 +03:00
|
|
|
<FormGroup name="who-killed">
|
2017-05-18 21:21:33 +03:00
|
|
|
<Legend>Who killed the radio star?</Legend>
|
|
|
|
<RadioList>
|
2017-10-12 21:15:51 +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>
|
2017-10-12 21:15:51 +03:00
|
|
|
</div>;
|
|
|
|
```
|