For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/en/components/input.md.

Input

Live previewHTML · CSS · JavaScript

Usage

Include CSS

Import Tailwind and one full A3S UI style bundle.

@import "tailwindcss";
@import "@a3s-lab/ui/a3s.css";

Or import only the base CSS, Input component CSS, and one style pack.

@import "tailwindcss";
@import "@a3s-lab/ui/base.css";
@import "@a3s-lab/ui/components/input.css";
@import "@a3s-lab/ui/styles/a3s.css";

Using CDN or bundler imports? See the Installation page.

Add your input HTML

Add class="input" to supported <input> elements. Inputs inside a class="field" container also receive the same styling automatically for common text-like input types.

Use native HTML attributes for behavior: disabled for disabled inputs, required for required fields, and aria-invalid="true" for invalid state styling.

<input class="input" type="email" aria-label="Email" placeholder="Email" />

Examples

Basic

Live previewHTML · CSS · JavaScript

Field

Use field with a label and description to create an accessible field.

Live previewHTML · CSS · JavaScript

Enter your email address.

Field group

Live previewHTML · CSS · JavaScript

Disabled

Live previewHTML · CSS · JavaScript

Invalid

Live previewHTML · CSS · JavaScript

File

Live previewHTML · CSS · JavaScript

Inline

Live previewHTML · CSS · JavaScript

Grid

Live previewHTML · CSS · JavaScript

Required

Live previewHTML · CSS · JavaScript

Badge

Live previewHTML · CSS · JavaScript

Input group

Use the Input Group patterns to add icons, text, or buttons inside an input.

Live previewHTML · CSS · JavaScript

Button group

Use Button Group when an input should be grouped with adjacent buttons.

Live previewHTML · CSS · JavaScript

Form

Live previewHTML · CSS · JavaScript

This is your public display name.

RTL

Inputs support right-to-left layouts through native browser direction handling. Add dir="rtl" to the input, field, or an ancestor.

Live previewHTML · CSS · JavaScript

مفتاح API الخاص بك مشفر ومخزن بأمان.