Checkbox
A control that allows the user to toggle between checked and not checked.
Usage
It's mandatory to wrap the whole component with the Tailwind tag.
const { Tailwind } = VM.require("uiisnear.near/widget/tailwind");
const { Checkbox } = VM.require("uiisnear.near/widget/checkbox");
if (Tailwind === undefined) return <></>;<Tailwind>
<Checkbox />
</Tailwind>API Reference
Checkbox
Contains all the parts of a checkbox. An input will also render when used within a form to ensure events propagate correctly.
| Prop | Type | Default |
|---|---|---|
defaultChecked | boolean | 'indeterminate' | --- |
checked | boolean | 'indeterminate' | --- |
onCheckedChange | function | --- |
disabled | boolean | --- |
required | boolean | --- |
name | string | --- |
value | string | on |
| Data attribute | Values |
|---|---|
| [data-state] | "checked" | "unchecked" | "indeterminate" |
| [data-disabled] | Present when disabled |
Classnames
Classnames available to customize the component.
| Function | Classname |
|---|---|
| Checkbox | checkboxClassname |
Examples
With text
You agree to our Terms of Service and Privacy Policy.