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

90 lines
2.1 KiB
Markdown
Raw Normal View History

2017-12-15 16:53:59 +02:00
#### Checkbox > Default
```jsx
const React = require('react');
const { default: FormGroup } = require('./group');
const { default: Label } = require('./label');
2017-12-15 16:53:59 +02:00
const { FormLabel, Checkbox } = require('./');
<FormGroup name="test">
2017-12-15 16:53:59 +02:00
<FormLabel style={{ marginBottom: '12px' }}>Label name</FormLabel>
<Checkbox>
2017-12-15 16:53:59 +02:00
<Label>Detailed explanations</Label>
</Checkbox>
<Checkbox>
2017-12-15 16:53:59 +02:00
<Label>Tips and tricks</Label>
</Checkbox>
<Checkbox>
2017-12-15 16:53:59 +02:00
<Label>Hints</Label>
</Checkbox>
2017-12-15 16:53:59 +02:00
</FormGroup>;
```
2017-12-15 16:53:59 +02:00
#### Checkbox > Active/Focused
```jsx
const React = require('react');
const { default: FormGroup } = require('./group');
const { default: Label } = require('./label');
2017-12-15 16:53:59 +02:00
const { FormLabel, Checkbox } = require('./');
<FormGroup name="test">
2017-12-15 16:53:59 +02:00
<FormLabel style={{ marginBottom: '12px' }}>Label name</FormLabel>
<Checkbox checked>
2017-12-15 16:53:59 +02:00
<Label>Detailed explanations</Label>
</Checkbox>
<Checkbox checked>
2017-12-15 16:53:59 +02:00
<Label>Tips and tricks</Label>
</Checkbox>
<Checkbox>
2017-12-15 16:53:59 +02:00
<Label>Hints</Label>
</Checkbox>
2017-12-15 16:53:59 +02:00
</FormGroup>;
```
2017-12-15 16:53:59 +02:00
#### Checkbox > Disabled
```jsx
const React = require('react');
const { default: FormGroup } = require('./group');
const { default: Label } = require('./label');
2017-12-15 16:53:59 +02:00
const { FormLabel, Checkbox } = require('./');
<FormGroup name="test">
2017-12-15 16:53:59 +02:00
<FormLabel style={{ marginBottom: '12px' }}>Label name</FormLabel>
<Checkbox disabled>
2017-12-15 16:53:59 +02:00
<Label>Detailed explanations</Label>
</Checkbox>
<Checkbox disabled>
2017-12-15 16:53:59 +02:00
<Label>Tips and tricks</Label>
</Checkbox>
<Checkbox disabled>
2017-12-15 16:53:59 +02:00
<Label>Hints</Label>
</Checkbox>
2017-12-15 16:53:59 +02:00
</FormGroup>;
```
#### Checkbox > Error
```jsx
const React = require('react');
const { default: FormMeta } = require('./meta');
const { default: FormGroup } = require('./group');
const { default: Label } = require('./label');
2017-12-15 16:53:59 +02:00
const { FormLabel, Checkbox } = require('./');
<FormGroup name="test">
2017-12-15 16:53:59 +02:00
<FormLabel style={{ marginBottom: '12px' }}>Label name</FormLabel>
<Checkbox error checked>
2017-12-15 16:53:59 +02:00
<Label>Detailed explanations</Label>
</Checkbox>
<Checkbox checked>
2017-12-15 16:53:59 +02:00
<Label>Tips and tricks</Label>
</Checkbox>
<Checkbox>
2017-12-15 16:53:59 +02:00
<Label>Hints</Label>
</Checkbox>
2017-12-15 16:53:59 +02:00
<FormMeta error>Somethings missing</FormMeta>
</FormGroup>;
```