QdsTextInput

Single-line text entry with built-in validation, form association, and accessibility.

Overview

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.

Usage

<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>

API Reference

Attributes

Properties

CSS Parts

CSS Custom Properties

Events

Validation Timing

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.

Example

<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>

Native fieldset disabling

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.