Integrated ResearchPicasso
Components

Input

A single-line text field. Always paired with a visible label.

{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}

A single-line text field. Always paired with a visible label.

Import

import { Input } from "@ir/ui";

Watch out

  • One addition Figma does not have: a read-only treatment. Figma's State axis is Default · Hover · Focus · Filled · Invalid · Disabled, so a read-only field would render identically to an editable one — and this component's own guidance tells people to reach for readOnly instead of disabled. Advice that produces an ambiguous control is not advice, so read-only gets a resting surface and no hover response. Figma needs the matching state.

Variants

AxisOptionsDefault
sizesm · mdmd

Do and don't

Give every input a visible label, and use the placeholder for format.

Don't — Use the placeholder as the label.

A placeholder disappears the moment someone types, so the field loses its name exactly when they are checking their answer. It also fails on autofill, and most placeholder colours do not meet contrast.

Show the shape of the answer — "SYD-03", "14:30 AEST".

Don't — Write an instruction in the placeholder — "Enter the probe name".

The label already says what the field is. The placeholder's one job is to remove ambiguity about format, which is where people actually get stuck.

Set aria-invalid and render a message that says what to do.

Don't — Signal an error with the red border alone.

Colour is not available to everyone, and a red border does not say what is wrong. aria-invalid is what a screen reader announces; the border is what a sighted user sees. Both or neither.

Use readOnly, or render it as text.

Don't — Disable an input to display a value someone cannot change.

A disabled input is skipped by keyboard navigation and often by screen readers, so the value becomes invisible. Disabled means "not available yet"; read-only means "yours to see, not to change".

Use Select, or Combobox when the set is long.

Don't — Use an Input when the answer is one of a known set.

A free-text field invites typos the system then has to reconcile — this is how "tenant", "Tenant" and "tenat" end up as three values.

Keep both — border/input/focused and the 2px ring.

Don't — Remove the focus ring because the border already changes.

A 1px border change is not a sufficient focus indicator, and in dark mode it is nearly invisible. The ring is what satisfies SC 2.4.7.

Pick the size by density — sm in a table row or toolbar, md in a form.

Don't — Reach for sm to fit more characters.

Size changes height and text size, not width. Width comes from the layout, and a 32px field in a form reads as a filter rather than something to fill in.

Accessibility

  • Every input needs a programmatic label — a <label htmlFor>, or aria-label when the label is genuinely visual chrome.
  • Invalid state is aria-invalid, not a prop, so assistive tech gets it at the same time as the border colour.
  • Do not use the native size attribute for width; it is measured in ex units and does not respond to the theme.

Where it is drawn

Figma — structure from figma, measurements from shadcn.

Open in Storybook

On this page