Skip to main content

Checkbox

shadow

A checkbox, or also a check box, is an element that allows users to select one or more options from a set. Click on the checkbox to change its status to true or false.

Basic usage

Placement End

Color

Indeterminate checkbox

When the indeterminate attribute is added, a checkbox is displayed whose default state is neutral, i.e. neither true nor false.

Variant

Adding the variant attribute with the value circle will display a checkbox in a round shape.

Attributes and Properties

checked

DescriptionIf true, the checkbox is activated.
Attributechecked
Typeboolean
Defaultfalse

color

DescriptionThe color to use from your application's color palette. The default options are "primary", "success", "warning", "danger", "complete", and "dark". For more information on colors, visit Customization Basics.
Attributecolor
Type"complete" | "danger" | "dark" | "primary" | "success" | "warning" | string | undefined
Defaultundefined

disabled

DescriptionIf true, the checkbox element cannot be interacted with.
Attributedisabled
Typeboolean
Defaultfalse

name

DescriptionDefines a name attribute that is important, for example, when used in forms.
Attributename
Typestring
Defaultthis.inputId

placement

DescriptionDisplays a checkbox after the description.
Attributeplacement
Typeany
Default``

Events

NameDescription
changeCalled when the element state changes.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
inputRefers to an input element of type checkbox
checkboxRefers to the inner div wrapping element

CSS Custom Properties

NameDescription
--wj-checkbox-border-radiusBorder radius of the checkbox
--wj-checkbox-color-baseBackground of the checkbox handle
--wj-checkbox-handle-border-radiusBackground of the checkbox handle when checked
--wj-checkbox-handle-colorBorder radius of the checkbox handle
--wj-checkbox-handle-heightBox shadow of the checkbox handle
--wj-checkbox-handle-shadowHeight of the checkbox handle
--wj-checkbox-handle-shadow-checkedMaximum height of the checkbox handle
--wj-checkbox-handle-widthHorizontal spacing around the checkbox handle
--wj-checkbox-heightTransition of the checkbox handle
--wj-checkbox-widthWidth of the checkbox handle

Slots

NameDescription
``The default location of the element content.