shadcn

Input

Forms 27

About

Displays a form input field or a component that looks like an input field.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Input to your project and fits it to your theme.

Code

How Input is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";

function InputDemo() {
  return <Input type="email" placeholder="Email" />;
}

function InputFile() {
  return (
    <div className="grid w-full max-w-sm items-center gap-1.5">
      <Label htmlFor="picture">Picture</Label>
      <Input id="picture" type="file" />
    </div>
  )
}

function InputDisabled() {
  return <Input disabled type="email" placeholder="Email" />;
}

function InputWithLabel() {
  return (
    <div className="grid w-full max-w-sm items-center gap-1.5">
      <Label htmlFor="email">Email</Label>
      <Input type="email" id="email" placeholder="Email" />
    </div>
  )
}

function InputWithButton() {
  return (
    <div className="flex w-full max-w-sm items-center space-x-2">
      <Input type="email" placeholder="Email" />
      <Button type="submit">Subscribe</Button>
    </div>
  );
}

export default {
  InputDemo,
  InputFile,
  InputDisabled,
  InputWithLabel,
  InputWithButton,
}

More by shadcn

View all
  • Navigation menu

    Navigation menu

    777
  • Calendar with time pressets

    Calendar with time pressets

    507
  • Sidebar

    Sidebar

    344
  • Sonner

    Sonner

    235
  • Chart

    Chart

    220
  • Icons

    Icons

    187
  • Dropdown Menu

    Dropdown Menu

    153
  • Calendar with event slots

    Calendar with event slots

    117

More in Forms

View all
  • Premium Auth

    Premium Auth

    519
  • Contact Card

    Contact Card

    1K
  • Form

    Form

    16
  • Authentication Card

    Authentication Card

    48
  • Book A Demo 1

    Book A Demo 1

    72
  • Book A Demo 4

    Book A Demo 4

    55
  • Login Form

    Login Form

    7
  • Login Card

    Login Card

    26