Input

Usage

Include CSS

Import Tailwind and one full Basecoat style bundle.

@import "tailwindcss";
@import "basecoat-css/vega.css";

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

@import "tailwindcss";
@import "basecoat-css/base.css";
@import "basecoat-css/components/input.css";
@import "basecoat-css/styles/vega.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" placeholder="Email" />

Examples

Basic

Field

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

Enter your email address.

Field group

Disabled

Invalid

File

Inline

Grid

Required

Badge

Input group

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

Button group

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

Form

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.

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