Skip to content

TextField

A precise, labelled input with native validation and clear error feedback.

Live — this one is real

Visible to your collaborators.

Usage

import { TextField } from "mizu-ui";

export function Example() {
  return (
    <TextField
      label="Project name"
      name="project"
      required
      placeholder="Untitled project"
      hint="Visible to your collaborators."
    />
  );
}

Source & setup

Import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Uses native React and CSS; install the package peers for root imports.

Inspect forms/Fields.tsx

Source is included in the npm package under src/forms/Fields.tsx.

Open full source ↗

Props

PropTypeDefaultDescription
labelstring—Visible input label.
hint / errorReactNode / string—Linked help and validation.
...inputInputHTMLAttributes—Native value, onChange, type, required, ref and validation.

Accessibility

A real labelled input; descriptions and errors use aria-describedby. Supports native input types and autocomplete.

Motion

CSS transitions explain state changes. Reduced motion removes travel.

Works alongside