Checkbox

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.

PropTypeDefault
defaultChecked
boolean | 'indeterminate'
---
checked
boolean | 'indeterminate'
---
onCheckedChange
function
---
disabled
boolean
---
required
boolean
---
name
string
---
value
string
on
Data attributeValues
[data-state]"checked" | "unchecked" | "indeterminate"
[data-disabled]Present when disabled

Classnames

Classnames available to customize the component.

FunctionClassname
CheckboxcheckboxClassname

Examples

With text

You agree to our Terms of Service and Privacy Policy.

Disabled