Single-line text entry with built-in validation, form association, and accessibility.
The qds-text-input component is a form-associated custom element that provides single-line text input. It is the reference implementation for the form-association pattern used by all six QDS form controls. It supports labels, hints, error messages, character counters, clear buttons, prefix/suffix icon slots, and three validation timing modes.
<qds-text-input label="Full Name" placeholder="Enter your name" required></qds-text-input>
<qds-text-input label="Search" type="search" clearable>
<i slot="prefix" class="pi pi-search"></i>
</qds-text-input>
<qds-text-input label="Email" type="email" required hint="We will never share your email."></qds-text-input>
value - (string) The current value; attribute sets the initial value.name - (string) Submitted form key.label - (string) Rendered as a real <label for> in the shadow root.placeholder - (string) Placeholder text, not a substitute for label.hint - (string) Helper text displayed below the input.error-text - (string) Overrides the built-in validation message.type - ('text' | 'search' | 'email' | 'tel' | 'url' | 'password') Input type, default text.size - ('sm' | 'md' | 'lg') Control height, default md.disabled - (boolean) Not focusable, not submitted.readonly - (boolean) Focusable, submitted, secondary background.required - (boolean) Field is required.invalid - (boolean) Author-forced invalid state.maxlength - (number) Maximum character count.minlength - (number) Minimum character count.pattern - (string) RegExp pattern for validation.autocomplete - (string) Autocomplete hint for the browser.show-counter - (boolean) Show character counter (requires maxlength).clearable - (boolean) Show a clear button when non-empty.validate-on - ('blur' | 'input' | 'submit') Validation timing, default blur.value - (string) Current value, synced with attribute in both directions.name - (string) Form field name.disabled - (boolean) Whether the control is disabled.readonly - (boolean) Whether the control is read-only.required - (boolean) Whether the control is required.type - (string) Input type.size - (string) Control size.validity - (QdsValidity) Read-only validity state.form - (HTMLFormElement | null) The associated form element.focus(options?) - Focuses the native input; forwards standard FocusOptions. Disabled inputs remain unfocusable. Available through the generated Quangular wrapper for validation and error-summary navigation.checkValidity() - Returns boolean, validates without showing the message.reportValidity() - Returns boolean, validates and shows the error message.setCustomValidity(msg) - Sets a custom error message; empty string clears it.container - Outer container.label - Label element.required - Required marker span inside the label.wrapper - Input wrapper (border surface).input - Inner input element.prefix - Prefix slot.suffix - Suffix slot.clear-button - Clear button.hint - Hint text.error - Error message.counter - Character counter.--qds-input-height - Control height (default var(--qds-control-height-md, 40px)).--qds-input-background - Control background (default var(--theme-background-primary)).--qds-input-border-color - Resting border color (default var(--theme-border-primary)).--qds-input-border-color-hover - Hover border color (default var(--theme-border-secondary)).--qds-input-border-color-focus - Focus border color (default var(--theme-accent-primary)).--qds-input-radius - Border radius (default var(--theme-radius-sm, 4px)).--qds-input-padding-x - Horizontal padding (default var(--theme-space-3, 12px)).input - Every keystroke; bubbles, composed.change - Value committed (blur or Enter); bubbles, composed.qds-validity-change - Validity flips or message changes; detail { component, valid, validity, message }.qds-clear - Clear button pressed; detail { component }.The Quangular investment pipeline uses focus() after rejecting an empty opportunity draft name. This fictional draft stays on the current screen and resets on navigation. Application browser checks exercise the generated wrapper in both themes.
validate-on="blur" (default) - Validates on blur. Once an error has been shown, subsequent input re-validates live so the error clears as soon as the value is valid.validate-on="input" - Validates on every keystroke.validate-on="submit" - Suppresses error display until reportValidity() is called.<form>
<qds-text-input
label="Email Address"
type="email"
name="email"
required
hint="We will never share your email."
show-counter
maxlength="100"
clearable
>
<i slot="prefix" class="pi pi-envelope"></i>
</qds-text-input>
<button type="submit">Submit</button>
</form>
Keep related controls in a native fieldset with a descriptive legend. Ancestor disabling is retained separately from the control’s own disabled attribute: assigning disabled = false cannot override a disabled ancestor. Re-enabling the fieldset restores interaction unless the control is explicitly disabled. Reporting values are retained while disabled. Generated Quangular forms respect the same effective state without turning ancestor state into a sticky own attribute.
The native demo includes a reporting-fieldset toggle and a disabled = false probe so this behavior can be checked alongside normal property disabling.