Home Reference Source
import Checkbox from 'prg-form/src/Checkbox.jsx'
public class | source

Checkbox

Extends:

ComponentBaseInput → 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"
/>

Inherited Summary

From class BaseInput
public

getValue(): any

Returns input value

public

resetValue(value: *)

Reset and clean the validation errors

public

setError(error: string)

Show error

public

setValue(value: any): any

Set new value to input