feat add input components
This commit is contained in:
29
src/components/input/index.tsx
Normal file
29
src/components/input/index.tsx
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { InputProps } from "../../types/props";
|
||||||
|
|
||||||
|
const Input = ({
|
||||||
|
label,
|
||||||
|
id,
|
||||||
|
type,
|
||||||
|
name,
|
||||||
|
placeholder,
|
||||||
|
extra,
|
||||||
|
...attrs
|
||||||
|
}: InputProps) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<label htmlFor={id} className="block mb-2 text-sm font-medium text-white">
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type={type}
|
||||||
|
name={name}
|
||||||
|
id={id}
|
||||||
|
className="outline-none border-none sm:text-sm rounded-lg block w-full p-2.5 md:p-3 bg-gray-700 border-gray-600 placeholder-gray-400 text-white"
|
||||||
|
placeholder={placeholder}
|
||||||
|
{...attrs}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Input;
|
||||||
Reference in New Issue
Block a user