EccBoolean
EccBoolean shows and edits a yes/no value as checkbox or toggle switch.
import { EccBoolean } from "@ecceene/ui-core";
The component uses the basic props of all field components - see Component Basics.
Examples
// 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:
|
|
| 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.
CSS
Change the look in the CSS file of your workspace, see Styling.
| wrapper of the field (default of |
| row of control and label |
| checkbox |
| toggle ( |
The field frame (label row, value, copy and info button) is the same for all fields, see Component Basics.
Related
super component: basic props | |
several yes/no options in one group |
On this page
- EccBoolean