Skip to content

Checkbox Module ​

The Checkbox module provides customizable checkbox inputs with configurable colors, border, radius, checked state, focus state, disabled state, and RTL/LTR support.

Signature:

scss
@mixin use-checkbox($colors: ());

Example:

scss
@include termeh.use-checkbox(("primary", "error"));

Module:

This module is registered as form-checkbox in the presented modules.

Dependencies

Checkbox module uses the following Termeh global var():

ComponentTypeUsageDefault
base → separatorColorFallback border colornull
radius → normalNumberDefault input border radiusnull
gap → microNumberSpacing between input and label8px
input → heightNumberInput height2.8em
input → checkboxNumberCheckbox item height1.2em
input → borderColorDefault input border colorFALLBACK
input → disabled-foregroundColorDisabled input accent colornull
input → disabled-borderColorDisabled input border colornull

Checkbox module uses the following Termeh color():

Color / VariantUsageDefault
errorAccent color for invalid stateerror
primaryDefault accent colorerror

Modifiers ​

  • .is-invalid / :invalid → applies error styling with shake animation
  • .is-disabled / :disabled → applies disabled styling
  • .is-<color> → applies a registered color as accent color

Child Elements ​

  • input[type="checkbox"] → the checkbox input element