- Components
- checkbox
Checkbox
Form control for independent or multi-select choices with optional inline labels and sizing.
Demo
<div class="flex flex-col gap-3">
<x-ui.checkbox id="def_check_checked" label="Default checkbox (Checked)" checked/>
<x-ui.checkbox id="def_check" label="Example 2"/>
</div>
Installation
Shell
php artisan flexi:add checkbox
API
| Prop | Description |
|---|---|
id
(string|null)
|
Input id. If omitted,
name
is used.
|
name
(string)
|
Input name attribute.
|
value
(string)
|
Submitted value when checked.
|
checked
(boolean)
|
Sets initial checked state.
|
disabled
(boolean)
|
Disables interaction and applies disabled styles.
|
size
(sm|md|lg)
|
Controls checkbox visual size.
|
label
(string)
|
Optional inline label rendered next to the checkbox.
|
Accessibility
-
Always provide a meaningful label, either via
labelor an external label element. -
For grouped checkboxes, wrap related options in a
fieldsetwith a clear legend. - Avoid using color alone to communicate checked or error states.