Input

Input is a thin native control for text-like, numeric, and platform temporal values; Field owns labels, descriptions, and validation messages.

Overview and decision boundary

Use Input for native text-like, numeric, or temporal values when browser-owned entry and form behavior fit the product.

Do not use placeholder text as the only label.

A label and description remain outside the native Input.

import { Field, Input } from "@nerio-ui/ui";<Field label="Project name" description="A label and description remain outside the native Input.">  <Input id="project-name" placeholder="Launch materials" autoComplete="organization" required /></Field>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm exec nerio add inputimport { Field, Input } from '@nerio-ui/ui';

Usage

import { Field, Input } from '@nerio-ui/ui';<Field label="Project name" description="Use a short recognizable name."><Input placeholder="Launch materials" required autoComplete="organization" /></Field>

Variants

VariantPurpose
sm / md / lgShared density-aware control sizes; md is the default.
Text-like typesText, email, password, search, tel, url, and number preserve native semantics.
Temporal typesDate, month, week, time, and datetime-local preserve browser pickers, localized chrome, and native values.

Anatomy

SlotPurpose
inputInput slot exposed through data-slot="input".

States

StateBehavior
DefaultAccepts supported values through native input behavior.
InvalidExposes aria-invalid and the danger border token without owning validation.
Read-onlyKeeps the value focusable and selectable without accepting edits.
DisabledRemoves the control from interaction and applies disabled tokens.

Motion

  • Hover transitions the border color through shared motion tokens.
  • Focus-visible animates the ring and border only.
  • Reduced motion keeps the state change but removes nonessential timing.

Accessibility

  • Use with Label or Field so the control has an accessible name.
  • Supports native input attributes including required, disabled, readOnly, min, max, step, autocomplete, and aria-describedby.
  • Temporal types preserve browser-owned pickers, localized chrome, native values, validity, and form submission.
  • Use the forwarded input ref for valueAsDate where supported and valueAsNumber; datetime-local does not have a standard valueAsDate representation.
  • Invalid state normalizes to aria-invalid=true only for true validation errors.
  • Disabled state uses the native disabled attribute; read-only stays focusable and selectable.
  • Supported types are text, email, password, search, tel, url, number, date, month, week, time, and datetime-local.

Review the shared responsibility and evidence boundaries in the Accessibility foundation alongside this component-specific contract. Use the Spacing & layout foundation for shared density, wrapping, overflow, reflow, and component-versus-product ownership guidance. The Color foundation, Typography foundation, and Localization foundation define the shared visual-role, text-resilience, direction, and locale boundaries used by component examples.

API

PropValuesPurpose
sizesm | md | lgSelects the density-aware control height.
htmlSizenumberForwards the native input size attribute where applicable.
typeSupported native typePreserves native keyboard and form semantics.
min / max / stepNative valuesForwards temporal and numeric constraints unchanged.
invalidbooleanExposes the invalid state for Field and FormMessage composition.
classNamestringExtends the root without replacing component tokens.

Implementation contract

ContractValue
Registry iteminput installs 7 source files.
Base UINo interactive primitive required.
Temporal behaviorNative browser and operating-system control.
Registry dependenciesNone.
Package dependenciesclsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Input for short values; use Textarea for longer notes.
  • Use native temporal types for platform entry; use Calendar or DatePicker only when their bounded custom UI is required.
  • Prefer Field when the control needs label, description, or validation message.

Do / do not

Do
Use autocomplete and inputMode intentionally, and compose labels and messages outside the native Input. Prefer temporal types when browser-owned entry, picker, validation, and direct form submission are the right product path.
Do not
Parse localized temporal display strings, suppress native picker affordances, or turn Input into Calendar, DatePicker, scheduling, or timezone workflow behavior.

Tokens

TokenGroupControls
--n-input-height-smSizingSmall control height.
--n-input-height-mdSizingDefault control height.
--n-input-height-lgSizingLarge control height.
--n-input-radiusShapeControl corner radius.
--n-input-backgroundSurfaceDefault control surface.
--n-input-foregroundSurfaceDefault input text.
--n-input-borderBorderDefault border.
--n-input-border-hoverBorderHover border.
--n-input-border-focusBorderFocused border.
--n-input-border-dangerInvalidInvalid border treatment.
--n-motion-focus-durationFocusFocus transition duration.
--n-focus-ringFocusVisible focus treatment.