Checkbox
June 18, 2019 ยท View on GitHub
User-interactive component.
Checkbox should be wrapped into FormGroup
Public interface
Props
Checkbox contains html <input type="checkbox" /> element. All props for <input type="checkbox" /> are valid for Checkbox.
Own props:
values- array with two elements. First -active value, second -disabled value.RequirederrorClassName- class that applies when model attribute is invalid. By default -has-error.activeClassName- class that applies when checkbox is checked. By default -is-active.nativeRef- callback for Reactref.Optional
Example
<Form
onSubmit={async (values) => await someRequest(values)}
validator={new SchemaValidator(ExampleSchema)}
errorParser={(error) => myCustomParser(error)}
>
<FormGroup attribute="IHaveRead">
<Checkbox values={[true, false]} />
</FormGroup>
</Form>