Xzero UI
Pro library

Input

A single line field with clear labels and useful states.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/input
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/input

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Input } from "@/components/xzero/input/input";

export function EmailField() {
  const [email, setEmail] = useState("");
  return (
    <Input
      label="Email"
      type="email"
      value={email}
      onChange={(event) => setEmail(event.target.value)}
      description="We only use this for receipts."
      error={email && !email.includes("@") ? "Enter a valid email" : undefined}
    />
  );
}

API reference

Input

A labelled text input with helper and error copy that open on a spring and reword in place.

PropTypeDefaultDescription
label (required)string–Visible label, tied to the input with htmlFor.
descriptionstring–Helper copy under the field, linked through aria-describedby.
errorstring–Error copy. Sets aria-invalid and renders in a role="alert" row.
...propsInputHTMLAttributes<HTMLInputElement>–Forwarded to the native input, including ref, type, value, onChange, and name.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in text fields

Guidance for AI tools

Input: A single line field with clear labels and useful states. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components