forms

Checkbox

Display a checkbox field.

Usage

<UCheckbox />

Label

Use the label prop to display a label on the right.

<UCheckbox label="Label" />

Required

Use the required prop to display a red star next to the label.

<UCheckbox label="Label" required />

Help

Use the help prop to display some text under the Checkbox.

Please check this box

<UCheckbox label="Label" help="Please check this box" />

Disabled

Use the disabled prop to disable the Checkbox.

<UCheckbox disabled />

Props

Prop Default Description
valuenullstring | number | boolean
modelValuenullboolean | unknown[]
namenullstring
labelnullstring
helpnullstring
requiredfalseboolean
disabledfalseboolean
uiappConfig.ui.checkboxany

Preset

{
  "wrapper": "relative flex items-start",
  "base": "h-4 w-4 text-primary-500 dark:text-primary-400 focus-visible:ring-2 focus-visible:ring-offset-2 bg-white dark:bg-gray-900 dark:checked:bg-current dark:checked:border-transparent focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900 border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-0 focus:ring-transparent focus:ring-offset-transparent rounded",
  "label": "font-medium text-gray-700 dark:text-gray-200",
  "required": "text-red-500 dark:text-red-400",
  "help": "text-gray-500 dark:text-gray-400"
}

Made by