Skip to content

Field Module ​

The Field module provides a wrapper for form controls, helping manage spacing, label styling, required indicators, help text, error states, and color variations.

This field is required

This field is disabled

Signature:

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

Example:

scss
@include termeh.use-field(("primary", "green"));

Module:

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

Dependencies

Field module uses the following Termeh global var():

ComponentTypeUsageDefault
gap → microNumberSpacing between blocks8px
gap → macroNumberBottom margin for input blocks1.6em

Field module uses the following Termeh color() and variant():

Color / VariantUsageDefault
shade → readableHelp block text colornull
primary → readableDefault required indicator colornull
error → readableError block text colornull

Modifiers ​

  • .is-required → adds a * to labels for required fields
  • .is-disabled / :disabled → applies disabled state to the input
  • .is-failed / :invalid → shows error message and applies error styling to children
  • .is-<color> → applies a registered color as accent color

Child Elements ​

  • .help → helper text for guidance
  • .error → error message displayed on validation failure