2017-12-06 17:03:40 +02:00
|
|
|
|
#### Radio > Default
|
|
|
|
|
|
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-12-06 17:03:40 +02:00
|
|
|
|
const { FormLabel } = require('./');
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
2017-10-12 21:15:51 +03:00
|
|
|
|
<FormGroup name="who-killed">
|
2017-12-06 17:03:40 +02:00
|
|
|
|
<FormLabel style={{marginBottom: '12px'}}>Who killed the radio star?</FormLabel>
|
2017-05-18 21:21:33 +03:00
|
|
|
|
<RadioList>
|
2017-12-06 17:03:40 +02:00
|
|
|
|
<Radio name="one" value="video">
|
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-12-06 17:03:40 +02:00
|
|
|
|
<Radio 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-12-06 17:03:40 +02:00
|
|
|
|
#### Checkbox > Active/Focused
|
|
|
|
|
```jsx
|
|
|
|
|
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');
|
|
|
|
|
const { FormLabel } = require('./');
|
|
|
|
|
|
|
|
|
|
<FormGroup name="test">
|
|
|
|
|
<FormLabel style={{marginBottom: '12px'}}>Who killed the radio star?</FormLabel>
|
|
|
|
|
<RadioList>
|
|
|
|
|
<Radio name="one" value="video" checked>
|
|
|
|
|
<Label>Video</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio name="one" value="tv">
|
|
|
|
|
<Label>TV</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio name="one" value="netflix">
|
|
|
|
|
<Label>Netflix</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
</RadioList>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
```
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
2017-12-06 17:03:40 +02:00
|
|
|
|
#### Checkbox > Disabled
|
|
|
|
|
```jsx
|
|
|
|
|
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');
|
|
|
|
|
const { FormLabel } = require('./');
|
|
|
|
|
|
|
|
|
|
<FormGroup name="test">
|
|
|
|
|
<FormLabel style={{marginBottom: '12px'}}>Who killed the radio star?</FormLabel>
|
|
|
|
|
<RadioList>
|
|
|
|
|
<Radio name="one" value="video" disabled>
|
|
|
|
|
<Label>Video</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio name="one" value="tv" disabled>
|
|
|
|
|
<Label>TV</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio name="one" value="netflix" disabled>
|
|
|
|
|
<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-10-31 12:03:44 +02:00
|
|
|
|
const React = require('react');
|
|
|
|
|
const { default: Radio, RadioList } = require('./radio');
|
|
|
|
|
const { default: FormGroup } = require('./group');
|
2017-12-06 17:03:40 +02:00
|
|
|
|
const { default: Label } = require('./label');
|
2017-10-31 12:03:44 +02:00
|
|
|
|
const { default: Legend } = require('./legend');
|
2017-12-06 17:03:40 +02:00
|
|
|
|
const { FormLabel } = require('./');
|
2017-10-31 12:03:44 +02:00
|
|
|
|
const { default: FormMeta } = require('./meta');
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
2017-12-06 17:03:40 +02:00
|
|
|
|
<FormGroup name="test">
|
|
|
|
|
<FormLabel style={{marginBottom: '12px'}}>Who killed the radio star?</FormLabel>
|
|
|
|
|
<RadioList>
|
|
|
|
|
<Radio name="one" value="video" error>
|
|
|
|
|
<Label>Video</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio name="one" value="tv" error>
|
|
|
|
|
<Label>TV</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio name="one" value="netflix" error>
|
|
|
|
|
<Label>Netflix</Label>
|
|
|
|
|
</Radio>
|
|
|
|
|
</RadioList>
|
|
|
|
|
<FormMeta error>
|
|
|
|
|
Something’s missing
|
|
|
|
|
</FormMeta>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
```
|