Input

Use Input for a short value such as an email address, password, or name. Choose Textarea for several lines of text.

Preview

Normal, invalid, and disabled inputs

Compare an email field with a placeholder, an explicitly invalid value, and a disabled workspace input.

Installation

New to this Registry? Complete the base setup before continuing.

npx shadcn@latest add @neumorphism-ui/input

Install the shared base once, then add components and their dependencies with the CLI.

Normal, invalid, and disabled inputs

npx shadcn@latest add @neumorphism-ui/input @neumorphism-ui/label
Registry JSON

Usage

Connect a visible Label with id and htmlFor, then set the native type, name, and autocomplete that fit the task. Associate help or errors with aria-describedby.

"use client";

import { useId } from "react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";

export default function Example() {
  const id = useId();
  return (
    <div className="grid gap-2">
      <Label htmlFor={id}>Email</Label>
      <Input id={id} name="email" type="email" autoComplete="email" placeholder="you@example.com" />
    </div>
  );
}

API Reference

Forwards every native input attribute while consistently styling the neumorphic inset surface, file input, disabled state, and aria-invalid state.

ComponentPropTypeDefaultDescription
InputtypeReact.HTMLInputTypeAttribute"text" (browser default)The native input type, such as email, password, or file.
Inputvalue / defaultValuestring | number—The controlled value or initial uncontrolled value.
Inputplaceholderstring—A short example that helps communicate the expected value format.
Inputdisabled / required / readOnlybooleanfalseSets native input constraints.
Inputaria-invalidboolean | string—Enables the error border and focus ring.

Accessibility

  • 01

    Connect Label htmlFor to the Input id, or provide an aria-label.

  • 02

    A placeholder does not replace Label and should only provide an example of the expected format.

  • 03

    For errors, set aria-invalid and connect the error message id with aria-describedby.