Skip to content

Input ​

Types

Loading...

States

Loading...

Sizes

Loading...

Input: a styled text input with label, help text, and error states.

  • Tag: <flint-input>
  • Class: FlintInput

Import ​

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

Usage ​

html
<flint-input></flint-input>

Properties ​

PropertyAttributeTypeDefaultDescription
labellabelstring''Label text displayed above the input.
valuevaluestring''Current value (controlled). When set, the component reflects this value and does not manage its own state.
typetypestring'text'HTML input type (text, email, password, etc.).
placeholderplaceholderstring''Placeholder text shown when the input is empty.
helperTexthelper-textstring''Help text displayed below the input.
errorerrorbooleanfalseWhether the input is in an error state.
errorMessageerror-messagestring''Error message displayed below the input.
disableddisabledbooleanfalseDisables the input and prevents interaction.
requiredrequiredbooleanfalseMarks the input as required for form validation.
readonlyreadonlybooleanfalseMakes the input read-only.
namenamestring''Form field name used when submitting form data.
autocompleteautocompletestring''Browser autocomplete hint.
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.
sizesizeSize'md'Size variant of the input.
variantvariant'outlined' | 'filled''outlined'Visual variant of the input.
pillpillbooleanfalseWhether to use pill-shaped (fully rounded) ends.
defaultValuedefault-valuestring | undefined—Initial value (uncontrolled). Only used on first render; ignored after mount.
clearableclearablebooleanfalseShows a clear button when the input has a value.
debouncedebouncenumber0Debounce delay in milliseconds for the flint-input-input event. 0 means no debounce. Useful for search inputs.
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-input-input&#123; value: string &#125;Fired on each keystroke as the value changes. detail: &#123; value: string &#125;
flint-input-change&#123; value: string &#125;Fired when the input loses focus after the value has changed. detail: &#123; value: string &#125;
flint-input-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
baseThe component wrapper.
labelThe label element.
inputThe native input element.
prefixThe prefix slot container.
suffixThe suffix slot container.
clear-buttonThe clear button.
password-toggle-buttonThe password toggle button.
help-textThe help text paragraph.
error-messageThe error message paragraph.

CSS Custom Properties ​

PropertyDefault
--flint-input-border-radius—
--flint-input-border-color—
--flint-input-bg—
--flint-input-border-hover-color—
--flint-input-placeholder-color—
--flint-input-search-icon-colorvar(--flint-input-placeholder-color
--flint-input-disabled-color—
--flint-input-disabled-bg—
--flint-input-readonly-bg—
--flint-input-filled-bgvar(--flint-surface-background-flat, #f3f4f6
--flint-input-filled-bg-hover#e5e7eb
--flint-font-family—
--flint-label-color—
--flint-primary-color—
--flint-primary-focus-ring—
--flint-error-color—
--flint-error-focus-ring—
--flint-text-color—
--flint-help-text-color—