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

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>