Input

Enter a value. Light tells whether it is valid, invalid or being checked.

Resources

Your details

Checked by the server. Try “Acme”.

To confirm the account.

Frames
0
Active effects
0
Renderer
none

When to use it

  • For short, free entry: name, email, password, code, date.
  • Not for long text (Textarea, coming soon), nor for picking among options: use a checkbox or radio buttons.

Recommendations

  • Server check (name already taken, promo code): set aria-busy while waiting, and keep aria-invalid until the new answer. Removing the error on typing would turn the field green before the server has confirmed.
  • Start the check after the same typing pause as the library (TYPING_PAUSE, 1 s), or when leaving the field.

Accessibility

The library

  • Native <input> element: keyboard, autofill, screen readers, ref and react-hook-form work as usual.
  • An error is not shown by color alone: thicker border and diode, with 3:1 contrast.
  • Visible focus at 3:1, without the shader. Text of at least 16 px, height of at least 44 px.
  • While loading, the orbit stops after 5 s; the diode stays steady.
  • Reduced motion: a simple fade. High contrast: system colors, no shader.

Integration

  • A visible label, tied to the field. Without a label, no "required" glow.
  • An error text, tied with aria-describedby or aria-errormessage: light doubles it, never replaces it.
  • A server response announced with aria-live.

WCAG 2.2 criteria: Use of Color · Non-text Contrast · Pause, Stop, Hide · Animation from Interactions · Focus Visible · Error Identification · Labels or Instructions · Status Messages

Props

PropTypePurpose
required, type, pattern…HTMLNative validity: read by the library, after interaction.
aria-invalidbooleanError set by your validation (Zod, react-hook-form) or the server.
aria-busybooleanCheck in progress: violet orbit, steady diode after 5 s.
effects{ onPaste: "ripple" }Effects triggered by DOM events.
onEffectEnd(e) => voidAlways called, even when the effect is skipped.
refShaderElement<HTMLInputElement>The native element, plus trigger().

Spec

The normative spec for this component: Formulaire

Availability and resources

Status
available · open source
Packages
@shader-ui/react (React, Next.js)
@shader-ui/core (TypeScript, plain HTML)
Source code
field.ts (core) · Input.tsx (React)