Overview
Radio buttons use the Form.Check with type prop as radio as a wrapper and adding custom prop. Custom checkbox and radio styles are achieved with a resourceful use of the :checked selector and :after pseudo elements.
Radios
API
Form
import Form from `@trimbleinc/modus-react-bootstrap/Form`| Name | Type | Default | Description |
|---|---|---|---|
| ref | ReactRef | The Form | |
| as | elementType | <form> | |
| inline | boolean | false | Display the series of labels, form controls, and buttons on a single horizontal row |
| validated | boolean | Mark a form as having been validated. Setting it to | |
| bsPrefix | string | {'form'} |
Form.Group
import Form.Group from `@trimbleinc/modus-react-bootstrap/Form.Group`| Name | Type | Default | Description |
|---|---|---|---|
| ref | ReactRef | The FormGroup | |
| as | elementType | <div> | |
| controlId | string | Sets | |
| bsPrefix | string | 'form-group' |
Form.Check
import Form.Check from `@trimbleinc/modus-react-bootstrap/Form.Check`| Name | Type | Default | Description |
|---|---|---|---|
| ref | ReactRef | The FormCheck | |
| as | 'input' | elementType | 'input' | The underlying HTML element to use when rendering the FormCheck. |
| children | node | Provide a function child to manually handle the layout of the FormCheck's inner components. | |
| custom | all(PropTypes.bool, ({ custom, id }) =>
custom && !id ? Error('Custom check controls require an id to work') : null,
) | Use Bootstrap's custom form elements to replace the browser defaults | |
| disabled | boolean | false | Disables the control. |
| feedback | node | A message to display when the input is in a validation state | |
| feedbackTooltip | boolean | false | Display feedback as a tooltip. |
| id | string | A HTML id attribute, necessary for proper form accessibility. An id is recommended for allowing label clicks to toggle the check control. This is required for custom check controls or when | |
| inline | boolean | false | Groups controls horizontally with other |
| isInvalid | boolean | false | Manually style the input as invalid |
| isValid | boolean | false | Manually style the input as valid |
| label | node | Label for the control. | |
| title | string | '' |
|
| type | 'radio' | 'checkbox' | 'switch' | 'checkbox' | The type of checkable. |
| bsPrefix | string | 'form-check' | |
| bsCustomPrefix | string | 'custom-control' | A seperate bsPrefix used for custom controls |
FormCheck.Input
import FormCheck.Input from `@trimbleinc/modus-react-bootstrap/FormCheck.Input`| Name | Type | Default | Description |
|---|---|---|---|
| as | 'input' | elementType | 'input' | The underlying HTML element to use when rendering the FormCheckInput. |
| id | string | A HTML id attribute, necessary for proper form accessibility. | |
| isInvalid | boolean | false | Manually style the input as invalid |
| isStatic | boolean | A convenience prop shortcut for adding | |
| isValid | boolean | false | Manually style the input as valid |
| type | 'radio' | 'checkbox' | 'checkbox' | The type of checkable. |
| bsPrefix | string | 'form-check-input' | |
| bsCustomPrefix | string | 'custom-control' | A seperate bsPrefix used for custom controls |