1 | # Control
|
2 |
|
3 | A Control represents a radio or checkbox widget with a label. Uses the Input component.
|
4 |
|
5 | ## Usage
|
6 |
|
7 | ```jsx
|
8 | import React from 'react';
|
9 | import Control from 'terra-form/lib/Control';
|
10 |
|
11 | <Control
|
12 | type="checkbox"
|
13 | defaultChecked={false}
|
14 | id="form-checkbox"
|
15 | inputAttrs={{ className: 'healtheintent-checkbox' }}
|
16 | labelText="Do you have any Children?"
|
17 | labelTextAttrs={{ className: 'healtheintent-control-label-text' }}
|
18 | name="children_present"
|
19 | onChange={() => {}}
|
20 | value="children_present"
|
21 | isInline
|
22 | />
|
23 | ```
|