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"));
Dependencies

Field module uses the following Termeh global var():

ComponentTypeUsageDefault
gapmicroNumberSpacing between blocks8px
gapmacroNumberBottom margin for input blocks1.6em

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

Color / VariantUsageDefault
shadereadableHelp block text colornull
primaryreadableDefault required indicator colornull
errorreadableError 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