Checkbox
A checkbox with label, description and error. Submits value when checked.
Source on GitHub
Send me updates (label as content)
Code
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-checkbox> · RayCheckbox
| Property | Attribute | Type | Default | Description |
|---|
checked | checked (initial) | boolean | | Current state. The checked attribute is the initial state (restored on reset). |
indeterminate | indeterminate reflects | boolean | | Mixed state; cleared on the next user change. |
value | value reflects | string | on | Submitted value when checked. |
name | name | string | | Form field name. |
label | label | string | | Label text (or put the label in the content). |
description | description | string | | Help text. |
error | error | string | | Error text. |
required | required | boolean | | Must be checked to submit. |
disabled | disabled | boolean | | Not interactive nor submitted. |
variant | variant reflects | filled | outline | filled | Checked look: filled box, or colored border and mark. |
color | color | string | | A palette color or any CSS color for the checked state. |
size | size reflects | xs | sm | md | lg | xl | sm | Box and font size. |
labelPosition | label-position reflects | end | start | right | left | end | Side of the label: start/end follow the writing direction; left/right are sides of the screen. |
| Event | Description |
|---|
change | When the user toggles it. |
| Slot | Description |
|---|
| (default) | Label content. |
| Part | Description |
|---|
input | The native checkbox (transparent, on top of the indicator). |
indicator | The drawn box. |
label | The label. |