Skip to content

Form Field ​

A form field wrapper that provides consistent layout (label + control + helper text + error message) for any slotted form control.

  • Tag: <flint-form-field>
  • Class: FlintFormField

Import ​

ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintFormField } from '@getufy/flint-ui';

Usage ​

html
<flint-form-field></flint-form-field>

Properties ​

PropertyAttributeTypeDefaultDescription
labellabelstring''Field label text.
helperTexthelper-textstring''Helper text displayed below the control.
errorMessageerror-messagestring''Error message displayed when error is true.
errorerrorbooleanfalseWhether the field is in an error state.
requiredrequiredbooleanfalseShows a required indicator next to the label.
disableddisabledbooleanfalseDisables the field and its slotted control.
labelPositionlabel-positionLabelPosition'top'Label placement relative to the control.

Slots ​

NameDescription
(default)The form control (e.g. FlintInput, FlintSelect, FlintCheckbox).
labelCustom label content (overrides the label prop).
helper-textCustom helper text content (overrides the helper-text prop).
error-messageCustom error message content (overrides the error-message prop).

CSS Parts ​

NameDescription
labelThe label element.
fieldThe control wrapper.
helper-textThe helper text element.
error-messageThe error message element.

CSS Custom Properties ​

PropertyDefault
--flint-form-field-gap6px
--flint-form-field-label-width120px
--flint-form-field-label-font-size0.875rem
--flint-form-field-label-font-weight500
--flint-form-field-required-color—
--flint-form-field-helper-font-size0.75rem
--flint-form-field-error-font-size0.75rem
--flint-form-field-error-color—
--flint-font-familysystem-ui, sans-serif
--flint-text-color—
--flint-text-color-muted—