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.

When to use

Use wje-checkbox when users need to enter values, choose options, or trigger form-related actions.

When not to use

Do not use it as a decorative element without interaction. Prefer presentational components in that case.

Accessibility

Always provide a label (label/aria-label), keep keyboard support, and surface clear validation feedback.

Best Practices

  • Keep validation rules and error behavior consistent across the entire form.
  • Show loading or disabled states during async operations.
  • Split complex forms into smaller sections with immediate feedback.

Attributes and Properties

checked

DescriptionGet checked attribute.
Attributechecked
Typeboolean
Default-

disabled

DescriptionDisables user interaction with the component.
Attributedisabled
Typeany
Default-

value

DescriptionGetter for the value attribute.
Attributevalue
Typestring
Default-

indeterminate

DescriptionRetrieves the current state of the 'indeterminate' attribute. The 'indeterminate' attribute is typically used to signify a state where a checkbox is neither checked nor unchecked, such as a partially selected state.
Attributeindeterminate
Typeboolean
Default-

required

DescriptionMarks the component as required for form validation.
Attributerequired
Typeany
Default-

invalid

DescriptionControls validation or status messaging for invalid.
Attributeinvalid
Typeboolean
Defaultfalse

label

DescriptionGetter for the label attribute.
Attributelabel
Typestring|null
Default-

Events

NameDescription
wje-toggle:inputEmitted when the input value changes.
wje-toggle:changeEmitted when the component value changes.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
nativeThe component's native wrapper.

CSS Custom Properties

NameDescription
--wje-checkbox-border-radiusBorder radius of the component;.
--wje-checkbox-border-widthBorder width of the component;.
--wje-checkbox-border-styleBorder style of the component;.
--wje-checkbox-border-colorBorder color of the component;.
--wje-checkbox-margin-inlineMargin inline of the component;.

Slots

NameDescription
defaultDefault slot for the main component content.