The boolean input field allows the choice between two items, or a True/False or Yes/No selection.
| field | Yes | (none) |
The field on the form that this control refers to. This will most likely be
a field on the form's related model. The field is used to generate defaults
for other attributes if they are not explicitly specified. Note: this field is optional if you're hanging |
| label | no |
ucfirst($field)
|
For
For |
| value | no | (none) |
The value of the field. Should either be |
| type | no | "radio" |
Set to one of
Note that this is not the same as the |
| choices | no | "yn" |
Shortcut for setting |
| choicetrue | no | "Yes" |
Label for the "true" option when type is set to "radio." Defaults to "Yes" (a Yes/No) pair. |
| choicefalse | no | "No" |
Label for the "false" option when type is set to "radio." Defaults to "No" (a Yes/No) pair. |
This component is ready to be used inside a Livewire component. It will render any
wire: attributes on the <input /> component itself. When using <x-euikit::form.boolean /> in a Livewire component, the "field"
attribute is optional, and will default to the value of
wire:model.
<x-euikit::form.boolean field="Choice" />
<x-euikit::form.boolean choices="oo" field="Driveway Floodlight" value="true"/>
<x-e::form.boolean type="checkbox" field="burn" value="1" label="Burn after reading" />