input.tsx 573 B

1234567891011121314151617181920
  1. import type { InputHTMLAttributes } from "react";
  2. import { cn } from "@/lib/utils";
  3. export function Input({
  4. className,
  5. type = "text",
  6. ...props
  7. }: InputHTMLAttributes<HTMLInputElement>) {
  8. return (
  9. <input
  10. type={type}
  11. className={cn(
  12. "flex h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50",
  13. className,
  14. )}
  15. {...props}
  16. />
  17. );
  18. }