Skip to main content
Version: Next

Checkbox API

import { Checkbox } from '@editora/ui-react';

Props​

PropTypeDescription
checkedboolean
defaultCheckedbooleanChecked at first, then left to the user (uncontrolled).
density'default' | 'compact' | 'comfortable'
disabledboolean
headlessboolean
indeterminateboolean
invalidboolean
loadingboolean
namestringForm field name: the checkbox takes part in <form> and ui-form submissions.
onChange(event: CustomEvent<CheckedDetail>) => void
onCheckedChange(checked: boolean, detail: CheckedDetail) => void
onInput(event: CustomEvent<CheckedDetail>) => void
preset'default' | 'admin'
requiredboolean
valuestringSubmitted value when checked (default "on").

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-checkbox>​

Checkbox renders the ui-checkbox custom element from @editora/ui-core, which can also be used without React.

Attributes: checked, disabled, headless, indeterminate, invalid, loading, tabindex

Events: change, input