Text Input

Commonly used text input component.

Examples

Input Fields

Basic form controls

Please enter a valid email address

Must be at least 8 characters long

Login Form

Login form with input fields

Welcome back

Enter your email to sign in to your account

Don't have an account? Sign up

Installation

npx wdc add input

Code

<wdc-text-input
  [ngModel]="nameValue()"
  (ngModelChange)="nameValue.set($event)"
  label="Your Name"
  placeholder="Your Name"
>
</wdc-text-input>
<wdc-text-input
  [ngModel]="emailValue()"
  (ngModelChange)="emailValue.set($event)"
  label="Email Address"
  type="email"
  placeholder="Email Address"
>
</wdc-text-input>
<wdc-text-input
  [ngModel]="passwordValue()"
  (ngModelChange)="passwordValue.set($event)"
  label="Password"
  type="password"
  placeholder="Password"
>
</wdc-text-input>

API Reference

InputTypeDefaultDescription
labelstringundefinedLabel text for the input field.
type'text' | 'email' | 'password' | 'number' | 'tel' | 'url''text'Type of input field.
placeholderstringundefinedPlaceholder text for the input field.
errorstring | nullnullError message to display when input is invalid.
disabledbooleanfalseWhether the input field is disabled.
valuestringundefinedValue of the input field.