joyent-portal/packages/ui-toolkit/src/form/usage-toggle.md
2017-09-26 17:07:45 +01:00

1.0 KiB

const { ToggleList } = require('./toggle');
const FormGroup = require('./group').default;
const Legend = require('./legend').default;

<FormGroup name='who-killed'>
  <Legend>Who killed the radio star?</Legend>
  <ToggleList>
    <Toggle value='video'>Video</Toggle>
    <Toggle value='tv'>TV</Toggle>
  </ToggleList>
</FormGroup>

selected

const { ToggleList } = require('./toggle');
const FormGroup = require('./group').default;
const Legend = require('./legend').default;

<FormGroup name='who-killed'>
  <Legend>Who killed the radio star?</Legend>
  <ToggleList>
    <Toggle value='video' checked>Video</Toggle>
    <Toggle value='tv'>TV</Toggle>
  </ToggleList>
</FormGroup>

disabled

const { ToggleList } = require('./toggle');
const FormGroup = require('./group').default;
const Legend = require('./legend').default;

<FormGroup name='who-killed' disabled>
  <Legend>Who killed the radio star?</Legend>
  <ToggleList>
    <Toggle value='video'>Video</Toggle>
    <Toggle value='tv'>TV</Toggle>
  </ToggleList>
</FormGroup>