Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 4ec5fb8

Browse files
authored
add input shadcn compoent
1 parent 00afbfe commit 4ec5fb8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

components/ui/input.tsx

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as React from "react";
2+
3+
import { cn } from "@/lib/utils";
4+
5+
export interface InputProps
6+
extends React.InputHTMLAttributes<HTMLInputElement> {}
7+
8+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
9+
({ className, type, ...props }, ref) => {
10+
return (
11+
<input
12+
type={type}
13+
className={cn(
14+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15+
className,
16+
)}
17+
ref={ref}
18+
{...props}
19+
/>
20+
);
21+
},
22+
);
23+
Input.displayName = "Input";
24+
25+
export { Input };

0 commit comments

Comments
 (0)