EccBoolean
EccBoolean shows and edits a yes/no value as checkbox or toggle switch.
TSX
import { EccBoolean } from "@/ecc/components/forms/EccBoolean";
The component uses the basic props of all field components - see Component Basics.
Examples
TSX
// read-only
<EccBoolean value="variables.purchase.personalData" data={process} trueLabel="Personal data" falseLabel="No personal data" />
// checkbox, written back to the start data
<EccBoolean value="purchase.involveIt" data={draft} valueOut editable trueLabel="Involve IT" falseLabel="Involve IT" />
// toggle switch with changing label
<EccBoolean fieldLabel="Approve request?" valueOut="output.decisionBoolean.approved" initValue={false}
checkStyle="toggle" editable trueLabel="Approve" falseLabel="Reject" />
// with info popover
<EccBoolean value="purchase.externalFunding" data={draft} valueOut editable trueLabel="External funding" falseLabel="External funding"
info="Additional fees / new examination and treatment methods" />
Props
Basic props, plus:
Prop
Type
Default
Description
|
|
| current value |
|
| - | object for the path |
|
|
| start value without |
|
|
| look |
|
| - | text next to the control when checked |
|
| - | text when unchecked |
Output: true or false. Use the same text for trueLabel and falseLabel for a classic checkbox label.
Related
Page
Relation
super component: basic props | |
several yes/no options in one group |
Was this section helpful?
On this page
- EccBoolean