Skip to main content

Figma Storybook

Input

A single-line text field for capturing freeform user input. Use for short, structured values like names, emails, and search queries.

Figma Storybook Docs

Description

What it does

Input captures a single line of user-entered text. It supports a range of HTML input types (text, email, password, number, search, URL) and integrates with form validation, error messaging, and accessibility patterns.

Where it appears

Login forms, registration flows, consultation setup, stakeholder profiles, search bars, filter panels, settings screens. Anywhere a short user response is needed.

Why it exists

A consistent input component ensures that labels, helper text, error states, and focus behaviour work the same way everywhere — reducing the cognitive overhead of learning each form in the product.

Dependencies

Built on Web Awesome wa-input, wrapped in FormControl for label, helper text, and error message association. For multi-line input, use TextArea.

Input types

Type HTML type Notes
Text text Default. Freeform single-line text entry.
Email email Mobile keyboard shows @. Browser validates format on submit.
Password password Characters masked. Always include a show/hide toggle.
Number number Numeric keyboard on mobile. Avoid for free-form numeric text (phone, postcodes) — use type="text" with inputmode.
Search search Shows clear button natively on some browsers. Pair with role="search" on the parent form.
URL url Browser validates URL format. Mobile keyboard shows .com shortcut.

States

State Behaviour
Default Neutral border, warm white background.
Focus Earthy green border (2px) and focus ring. The border colour shift provides a secondary focus indicator beyond the outline.
Filled Has value. No distinct visual treatment beyond default — value is the signal.
Error Red border. Error icon in label area. Error message below field, associated via aria-describedby. aria-invalid="true" on the input.
Disabled 50% opacity. Not interactive. Field value preserved visually. Associated label reads "disabled".
Read-only Value displayed but not editable. Subtly different treatment from disabled — still focusable, still selectable. Use readonly attribute.

Anatomy

PartRequired?Notes
Label Required Always visible. Never use placeholder text as a substitute for a label.
Input field Required The text entry area. Height 40px (medium), 32px (small).
Helper text Optional Appears below the field. Adds context the label alone can't provide. Associated via aria-describedby.
Error message Conditional Replaces helper text when validation fails. Associated via aria-describedby. Prefaced with an error icon.
Prefix / suffix Optional Icon or text rendered inside the input boundary. Use for affordances like currency symbols, units, or search icons.
Clear button Optional Appears when the field has a value. Clears the input. Accessible — labelled "Clear".
Password toggle Conditional Show/hide password button — required for all password inputs.

Usage guidelines

When to use

  • Short, bounded responses: names, emails, references, search terms, URLs.
  • Anywhere a single line of user input is sufficient.

When not to use

  • Multi-line responses — use TextArea.
  • Selecting from a defined list — use Dropdown, RadioButton, or Selector.
  • Date and time values — use DateTimePicker.
  • Numeric ranges or sliders — use RangeSlider.

Do / Don't

Do

Always pair an Input with a visible label. Never rely on placeholder text as the label — it disappears when the user starts typing.

Don't

Don't use type="number" for phone numbers, postcodes, or credit card numbers. These are structured text, not quantities — use type="text" with inputmode="numeric".

Do

Show the error message as soon as the user leaves the field (on blur) — not only on form submission.

Don't

Don't mark all fields as required — only mark required fields, and mark them consistently. Required indicators should have a text equivalent, not just a red asterisk.

Do

Use helper text to set expectations before the user types: "Must be at least 8 characters", "Enter the email address associated with your account".

Don't

Don't use helper text to restate the label. It should add context, not repeat it.

Was this page helpful?

Updated 9 September 2026