# Input

shadcn input as a sunken 1-bit field.

Source: https://www.ui95.dev/ui/input

## Examples

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

import type { ShowcaseDemo } from "../types"

export const demo: ShowcaseDemo = {
  span: "single",
  variants: [
    { label: "default", render: () => <Input defaultValue="C:\\AUTOEXEC.BAT" aria-label="Path" /> },
    { label: "placeholder", render: () => <Input placeholder="Type a filename" aria-label="Filename" /> },
    { label: "disabled", render: () => <Input disabled defaultValue="Read only" aria-label="Disabled" /> },
    {
      label: "invalid",
      render: () => <Input aria-invalid defaultValue="CON.TXT" aria-label="Invalid filename" />,
    },
    { label: "file", render: () => <Input type="file" aria-label="Upload" /> },
  ],
}
```

## Installation

```bash
npx shadcn@latest add https://www.ui95.dev/r/input.json
```

Run it in a Radix shadcn project that already has the UI95 theme.

Dependencies:

```bash
npm install cn
```

`components/ui/input.tsx`

```tsx
import { cn } from "cn"
import * as React from "react"

function Input({ className, type, ...props }: React.ComponentProps<"input">) {
  return (
    <input
      type={type}
      data-slot="input"
      className={cn(
        "h-10 w-full min-w-0 pixel-border border-border well px-2 bg-input text-foreground text-xl leading-none file:mr-2 file:inline-flex file:h-6 file:border-0 file:bg-transparent file:font-pixel file:text-[16px] file:text-foreground file:uppercase placeholder:text-well-muted disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground aria-invalid:border-dashed aria-invalid:border-destructive",
        className
      )}
      {...props}
    />
  )
}

export { Input }
```

## API reference

### Input

No props of its own. It forwards the props of the element or primitive it wraps.

## Used by

- [input-group](https://www.ui95.dev/ui/input-group)
- [sidebar](https://www.ui95.dev/ui/sidebar)

## Sounds

- `typewriter.key`
- `typewriter.space`
- `typewriter.return`
