summaryrefslogtreecommitdiff
path: root/src/components/Input.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 05:43:24 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 05:43:24 +0300
commit8e907e75ea1efa555ba66332b73d2f54283331c6 (patch)
treef7879bf46b0bb82b37e77eb827eb2ca3b9fa8211 /src/components/Input.tsx
parentfcf3c87195e9e58af9c2c4f2ae45b2a03c8d2677 (diff)
downloadcommercel-ui-8e907e75ea1efa555ba66332b73d2f54283331c6.tar.gz
feat: add Input component
Diffstat (limited to 'src/components/Input.tsx')
-rw-r--r--src/components/Input.tsx21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/Input.tsx b/src/components/Input.tsx
new file mode 100644
index 0000000..69b97a2
--- /dev/null
+++ b/src/components/Input.tsx
@@ -0,0 +1,21 @@
+import React from 'react';
+
+export interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
+ label?: string;
+}
+
+const Input: React.FC<Props> = ({ label, ...props }) => {
+ return (
+ <div className="m-2 mb-4 flex flex-col">
+ <label htmlFor={props?.name} className="mb-1 text-gray-700">{label}</label>
+ <input
+ id={props?.name}
+ placeholder={label}
+ className="p-2 border-2 border-black focus:outline-none"
+ {...props}
+ />
+ </div>
+ );
+};
+
+export default Input;