import { Input } from "@elabs-ai/components-ui";npm install @elabs-ai/components-tokens @elabs-ai/components-uiPaste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.
Add the brand-ui Input component (from @elabs-ai/components-ui) to this project. 1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`. 2. Look Input up before writing code: `npx -y @elabs-ai/components-cli docs Input` prints its real props, variants, what it pairs with and what to avoid. 3. If @elabs-ai/components-ui is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`. 4. Use it here: [the screen or file, and what it should show] 5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop. 6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.
Avoid
- Hand-building a search field on it — a leading icon plus a clear button is SearchInput in @elabs-ai/components-data.
- Input without an associated Label (visible or sr-only) — it has no accessible name.
- Blocking paste (onPaste + preventDefault) — never block paste.
- Wrong type/inputmode — use type=email/tel/url/number + inputmode so mobile keyboards + validation match.
- Missing autocomplete + a meaningful name on a real form field.
Works with
Examples
Invalid
Disabled
In Ambient Text Container
Regression lock for #49: `Input` must set its OWN text colour rather than inherit whatever ambient ink its container declares. Nested inside a `text-sidebar-foreground` wrapper (the `sidebar-04` mail search field's real shape), the input's resolved `color` must still match an un-nested `Input`'s — not the wrapper's near-invisible-on-`--background` sidebar ink. Runs in the Storybook browser project so `getComputedStyle` reflects the real Tailwind/token cascade (a jsdom unit test has none — `css: false` in `vitest.config.ts` — so it can only assert the class list, which would stay green even if a later change kept the class string but lost the cascade). Checked in BOTH themes via an in-place `data-theme` flip (no remount), so the fix is verified theme-safe rather than merely assumed to be from the class being additive.
API
Input
Theming
The tokens each state resolves to. Change the token and every theme follows.
| State | Token |
|---|---|
| rest | border-input + bg-input-background + shadow-input (the subtle form-field hairline, ADR 0010) |
| focus | focus-ring — the compound indicator: a ring-2 in --ring plus a 1px --ring-contour outline (#67) + ring-offset-1 ring-offset-background (the border does NOT change) |
| disabled | opacity-50 cursor-not-allowed + bg-muted |
| invalid | border-destructive + ring-destructive (aria-invalid) |