joyent-portal/packages/ui-toolkit/src/form/usage-radio.md
Sérgio Ramos d84f972fbe smaller and simpler Card api (#821)
* feat(ui-toolkit): smaller and simpler Card api

fixes: #809
fixes: #777

* feat(ui-toolkit) - Make adjustments to header (#824)

* feat(ui-toolkit) - Make adjustments to header

* feat(ui-toolkit) - Make adjustments to header

* add issue and pull request templates (#819)

* feat(all) - Add issue and pull ruequest templates

* Update PULL_REQUEST_TEMPLATE.md

* Create COMMIT_GUIDELINES.md

* Update PULL_REQUEST_TEMPLATE.md

* Update PULL_REQUEST_TEMPLATE.md

* Update COMMIT_GUIDELINES.md

* feat(ui-toolkit): smaller and simpler Card api

fixes: #809
fixes: #777
2017-10-31 10:03:44 +00:00

2.2 KiB

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');

<FormGroup name="who-killed">
  <Legend>Who killed the radio star?</Legend>
  <RadioList>
    <Radio name="one" value="video" checked>
      <Label>Video</Label>
    </Radio>
    <Radio name="one" value="tv">
      <Label>TV</Label>
    </Radio>
    <Radio disabled name="one" value="netflix">
      <Label>Netflix</Label>
    </Radio>
  </RadioList>
</FormGroup>;

Radio input validation

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');

<div>
  <FormGroup name="who-killed">
    <Legend>Who killed the radio star?</Legend>
    <RadioList>
      <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>
    </RadioList>
    <FormMeta left success>
      You are the best !
    </FormMeta>
  </FormGroup>
  <FormGroup name="who-killed">
    <Legend>Who killed the radio star?</Legend>
    <RadioList>
      <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>
    </RadioList>
    <FormMeta left warning>
      Are you sure ?
    </FormMeta>
  </FormGroup>
  <FormGroup name="who-killed">
    <Legend>Who killed the radio star?</Legend>
    <RadioList>
      <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>
    </RadioList>
    <FormMeta error left>
      You need to select one
    </FormMeta>
  </FormGroup>
</div>;