Basic Checkbox
Checked Checkbox
Disabled Checkbox
Checked and Disabled
Color Variants
Required Checkbox
Toggle Switches
Basic Toggle
Checked Toggle
Toggle Sizes
Disabled Toggle
Radio Buttons
Basic Radio Group
Checked Radio
Radio Color Variants
Disabled Radio
Documentation
Basic Usage
<x-checkbox label="Label text" name="checkbox1" value="test" />
Checkbox Props
-
label- stringText displayed next to the checkbox
-
name- stringInput name attribute
-
value- stringInput value attribute
-
checked- boolCheckbox starts in checked state
-
disabled- boolDisable the checkbox
-
color- stringCheckbox color variant:
primary,secondary,success,warning,error,sky. Default:primary -
required- boolMake the checkbox required
-
id- stringInput ID attribute (auto-generated if not provided)
Examples
Basic checkbox:
<x-checkbox label="Label" name="checkbox1" value="test" />
Checked:
<x-checkbox label="Label" name="checkbox1" value="test" checked />
Disabled:
<x-checkbox label="Label" name="checkbox1" value="test" disabled />
Color variant:
<x-checkbox label="Label" name="checkbox1" value="test" color="success" />
Required:
<x-checkbox label="Label" name="checkbox1" value="test" required />
Toggle Component
Basic Usage
<x-toggle label="Label text" name="toggle1" />
Toggle Props
-
label- stringText displayed next to the toggle
-
name- stringInput name attribute
-
value- stringInput value attribute (default: "1")
-
checked- boolToggle starts in checked state
-
disabled- boolDisable the toggle
-
size- stringToggle size:
sm,lg. Default: normal -
required- boolMake the toggle required
Radio Component
Basic Usage
<x-radio name="gender" value="male" label="Male" />
<x-radio name="gender" value="female" label="Female" />
Note: Radio buttons with the same name form a group where only one can be selected.
Radio Props
-
label- stringText displayed next to the radio button
-
name- stringInput name attribute (must be same for radio group)
-
value- stringInput value attribute (required, must be unique within group)
-
checked- boolRadio starts in checked state
-
disabled- boolDisable the radio button
-
color- stringRadio color variant:
primary,secondary,success,warning,error,sky. Default:primary -
required- boolMake the radio button required