Skip to content

Text Field ​

States

Loading...

Text Field: a styled text input with outlined/filled variants.

  • Tag: <flint-text-field>
  • Class: FlintTextField

Import ​

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

Usage ​

html
<flint-text-field></flint-text-field>

Properties ​

PropertyAttributeTypeDefaultDescription
labellabelstring''Label text displayed above the input.
valuevaluestring''Current value of the text field.
placeholderplaceholderstring''Placeholder text shown when the input is empty.
typetypestring'text'HTML input type (e.g. 'text', 'password', 'email').
variantvariant'outlined' | 'filled''outlined'Visual style variant of the text field.
disableddisabledbooleanfalseWhether the text field is disabled.
errorerrorbooleanfalseWhether the text field is in an error state.
helperTexthelperTextstring''Helper text displayed below the input.
errorMessageerrorMessagestring''Error message displayed below the input when in error state.
defaultValuedefault-valuestring''Initial value for uncontrolled usage.
namenamestring''Form field name used when submitting form data.
requiredrequiredbooleanfalseMarks the input as required for form validation.
patternpatternstring''Regex pattern for validation.
minminstring''Minimum value (for number/date inputs).
maxmaxstring''Maximum value (for number/date inputs).
minLengthminlengthnumber | undefined—Minimum length for text validation.
maxLengthmaxlengthnumber | undefined—Maximum length for text validation.
readonlyreadonlybooleanfalseMakes the input read-only.
clearableclearablebooleanfalseShows a clear button when the input has a value.
passwordTogglepassword-togglebooleanfalseShows a toggle button on password inputs to reveal/hide the value.
passwordVisiblepassword-visiblebooleanfalseWhether the password is currently visible. Only relevant when passwordToggle is true.

Events ​

EventDetailDescription
flint-text-field-input&#123; value: string &#125;Fired on each keystroke as the value changes. detail: &#123; value: string &#125;
flint-text-field-change&#123; value: string &#125;Fired when the input loses focus after the value has changed. detail: &#123; value: string &#125;
flint-text-field-clearundefinedFired when the clear button is clicked. detail: undefined

Slots ​

NameDescription
prefixContent placed before the input (e.g. icon).
suffixContent placed after the input (e.g. icon).

CSS Parts ​

NameDescription
prefix-iconThe prefix slot container.
suffix-iconThe suffix slot container.
clear-buttonThe clear button.
password-toggle-buttonThe password toggle button.

CSS Custom Properties ​

PropertyDefault
--flint-text-field-margin-bottom0
--flint-font-family—
--flint-label-color—
--flint-input-bg—
--flint-input-border-color—
--flint-input-border-radius—
--flint-input-border-hover-color—
--flint-primary-color—
--flint-primary-focus-ring—
--flint-error-color—
--flint-error-focus-ring—
--flint-input-disabled-bg—
--flint-input-placeholder-color—
--flint-text-color-muted—
--flint-text-color—
--flint-help-text-color—
--flint-surface-2—
--flint-hover-color—