joyent-portal/packages/ui-toolkit/src/form/usage-toggle.md

36 lines
926 B
Markdown
Raw Normal View History

```jsx
const React = require('react');
const { ToggleList } = require('./toggle');
const { default: FormGroup } = require('./group');
const { default: Legend } = require('./legend');
const { default: Toggle } = require('./toggle');
2017-10-12 21:15:51 +03:00
<FormGroup name="who-killed-1">
<Legend>Who killed the radio star?</Legend>
<ToggleList>
2017-10-12 21:15:51 +03:00
<Toggle value="video" checked>
Video
</Toggle>
<Toggle value="tv">TV</Toggle>
</ToggleList>
2017-10-12 21:15:51 +03:00
</FormGroup>;
```
#### Toggle > Disabled
```jsx
const React = require('react');
const { ToggleList } = require('./toggle');
const { default: FormGroup } = require('./group');
const { default: Legend } = require('./legend');
const { default: Toggle } = require('./toggle');
2017-10-12 21:15:51 +03:00
<FormGroup name="who-killed-2" disabled>
<Legend>Who killed the radio star?</Legend>
<ToggleList>
2017-10-12 21:15:51 +03:00
<Toggle value="video">Video</Toggle>
<Toggle value="tv">TV</Toggle>
</ToggleList>
2017-10-12 21:15:51 +03:00
</FormGroup>;
```