Skip to content

Demos

No label or value

<Field.Boolean onChange={(value) => console.log('onChange', value)} />

Checkbox

Value: true

<Field.Boolean
variant="checkbox"
label="Label text"
value={true}
onChange={(value) => console.log('onChange', value)}
/>

Value false

<Field.Boolean
variant="checkbox"
label="Label text"
value={false}
onChange={(value) => console.log('onChange', value)}
/>

Checkbox - Required

<Field.Boolean
variant="checkbox"
label="Set to be required initially"
onChange={(value) => console.log('onChange', value)}
validateInitially
required
/>

Checkbox - Disabled

<Field.Boolean
variant="checkbox"
label="I am disabled"
onChange={(value) => console.log('onChange', value)}
disabled
/>

Checkbox - Error

This is what is wrong...
<Field.Boolean
variant="checkbox"
label="Label text"
onChange={(value) => console.log('onChange', value)}
error={new Error('This is what is wrong...')}
/>

Button

Value true

<Field.Boolean
variant="button"
label="Label text"
value={true}
onChange={(value) => console.log('onChange', value)}
/>

Button - Value false

<Field.Boolean
variant="button"
label="Label text"
value={false}
onChange={(value) => console.log('onChange', value)}
/>

Button - Required

<Field.Boolean
variant="button"
label="Set to be required initially"
onChange={(value) => console.log('onChange', value)}
validateInitially
required
/>

Button - Disabled

<Field.Boolean
variant="button"
label="I am disabled"
onChange={(value) => console.log('onChange', value)}
disabled
/>

Button - Error

This is what is wrong...
<Field.Boolean
variant="button"
label="Label text"
onChange={(value) => console.log('onChange', value)}
error={new Error('This is what is wrong...')}
/>

Checkbox button

Value: true

<Field.Boolean
variant="checkbox-button"
label="Label text"
value={true}
onChange={(value) => console.log('onChange', value)}
/>

Checkbox button - Value false

<Field.Boolean
variant="checkbox-button"
label="Label text"
value={false}
onChange={(value) => console.log('onChange', value)}
/>

Checkbox button - Required

<Field.Boolean
variant="checkbox-button"
label="Set to be required initially"
onChange={(value) => console.log('onChange', value)}
validateInitially
required
/>

Checkbox button - Disabled

<Field.Boolean
variant="checkbox-button"
label="I am disabled"
onChange={(value) => console.log('onChange', value)}
disabled
/>

Checkbox button - Error

This is what is wrong...
<Field.Boolean
variant="checkbox-button"
label="Label text"
onChange={(value) => console.log('onChange', value)}
error={new Error('This is what is wrong...')}
/>

Buttons

Value true

<Field.Boolean
variant="buttons"
label="Label text"
value={true}
onChange={(value) => console.log('onChange', value)}
/>

Buttons - Value false

<Field.Boolean
variant="buttons"
label="Label text"
value={false}
onChange={(value) => console.log('onChange', value)}
/>

Buttons - Required

<Field.Boolean
variant="buttons"
label="Set to be required initially"
onChange={(value) => console.log('onChange', value)}
validateInitially
required
/>

Buttons - Disabled

<Field.Boolean
variant="buttons"
label="I am disabled"
onChange={(value) => console.log('onChange', value)}
disabled
/>

Buttons - Error

This is what is wrong...
<Field.Boolean
variant="buttons"
label="Label text"
onChange={(value) => console.log('onChange', value)}
error={new Error('This is what is wrong...')}
/>