Checkbox
Extends:
Component → BaseInput → Checkbox
Checkbox input In Addition to {BaseInput} has theese props:
PropTypes
property | type | type signature | description |
---|---|---|---|
name |
string |
required | input name (you can use dots and array indexes) |
label |
string |
input label | |
type |
string |
"text" |
input type |
className |
string |
input class | |
controlClass |
string |
surrounding paragraph class | |
defaultValue |
any |
is used, when input value is falsey | |
value |
any |
use, when input is operated outside <Form> |
|
onChange |
function |
(value, input) => {} |
fired, when input is changed |
disabled |
boolean |
disable input | |
readOnly |
boolean |
only read | |
required |
boolean |
input is required - HTML attribute | |
checkValue |
any |
if provided, is used as value of checked input |
Example:
// works as boolean
<Checkbox
name="someBoolean"
/>
// works as `null|checkValue`
<Checkbox
name="someBoolean"
checkValue="someString"
/>