# Input

A text field carved into the surface: the opposite of a button, it sinks in.

Docs: https://cozy-ui.solo.engineer/docs/components/input/

Install: `npx shadcn@latest add @cozy/input`

### Usage

```tsx
import { Input } from "@/components/ui/input"

<Input placeholder="Name your village…" />
```

Set aria-invalid="true" for errors and always pair it with text; colour alone is never the only signal.

### Example

```tsx
import { Input } from "@/components/ui/input";

export default function InputDemo() {
  return <Input className="max-w-sm" placeholder="Name your village…" />;
}
```

### Source (components/ui/input.tsx)

```tsx
import * as React from "react";
import { cn } from "@/lib/utils";

function Input({ className, type, ...props }: React.ComponentProps<"input">) {
  return <input type={type} data-slot="input" className={cn("cz-input", className)} {...props} />;
}

export { Input };
```

npm: `import { Input } from "@0xtrou/cozy-ui"` (after `npm install @0xtrou/cozy-ui` and `import "@0xtrou/cozy-ui/styles.css"`).
