my/ui

Command Palette

Search for a command to run...

All components

Input

inputs

Origin UI component.

responsive · 380px

Install

Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:

$npx shadcn@latest add https://your-domain/r/origin-ui-input.json

Usage

"use client";

import { Input } from "@/registry/origin-ui/input";

export default function Demo() {
  return (
    <div className="w-full max-w-xs space-y-2">
      <label
        className="text-sm font-medium text-foreground"
        htmlFor="demo-input"
      >
        Email address
      </label>
      <Input
        id="demo-input"
        placeholder="you@example.com"
        type="email"
      />
    </div>
  );
}

Component source

import type * as React from "react";

import { cn } from "@/lib/utils";

function Input({ className, type, ...props }: React.ComponentProps<"input">) {
  return (
    <input
      className={cn(
        "flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground/70 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
        "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
        "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
        type === "search" &&
          "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
        type === "file" &&
          "p-0 pr-3 text-muted-foreground/70 italic file:me-3 file:h-full file:border-0 file:border-input file:border-r file:border-solid file:bg-transparent file:px-3 file:font-medium file:text-foreground file:text-sm file:not-italic",
        className,
      )}
      data-slot="input"
      type={type}
      {...props}
    />
  );
}

export { Input };

Source: Origin UI