Skip to Content
Dither

Dither / components

Input

Single-line text field. Same height as a button of the same size.

  • Stable
  • 4 variants
  • 2 props
  • Light & Dark
light
dark
Code
import { Input } from "@/components/ui/input";import { Label } from "@/components/ui/label";export default function InputDemo() {  return (    <div className="grid w-full max-w-xs gap-2">      <Label htmlFor="input-demo-email">Work email</Label>      <Input id="input-demo-email" type="email" placeholder="you@northwind.studio" />    </div>  );}

Installation

npx shadcn add @dither/input

Usage

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

<Input placeholder="you@northwind.studio" />

Guidelines

  • Always pair with a visible label (use Field); placeholders are examples, not labels.
  • Errors go under the field, in a sentence that says how to fix it.
  • Same height as buttons and selects at the same size: align them in one row.

Props

Prop

Type

Examples

Sizes

light
dark
Code
import { Input } from "@/components/ui/input";export default function InputSizes() {  return (    <div className="grid w-full max-w-xs gap-2">      <Input size="xs" placeholder="Extra small · 32" />      <Input size="sm" placeholder="Small · 36" />      <Input placeholder="Default · 40" />      <Input size="lg" placeholder="Large · 44" />    </div>  );}

States

light

A project with this name already exists.

dark

A project with this name already exists.

Code
import { Input } from "@/components/ui/input";import { Label } from "@/components/ui/label";export default function InputStates() {  return (    <div className="grid w-full max-w-xs gap-4">      <div className="grid gap-2">        <Label htmlFor="input-states-invalid">Project name</Label>        <Input id="input-states-invalid" aria-invalid defaultValue="Atlas" />        <p className="text-xs text-destructive-ink">A project with this name already exists.</p>      </div>      <Input disabled placeholder="Disabled" />      <Input type="file" aria-label="Attachment" />    </div>  );}
Dither · Inputv0.2.0

On this page