-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInput.jsx
49 lines (48 loc) · 1.19 KB
/
Input.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from 'react';
export const Input = ({
id,
name,
type,
dataValue,
value,
autoComplete,
display,
width,
padding,
borderRadius,
bgStyles,
borderStyles,
textColor,
placeHolderColor,
placeholder,
onChange,
onBlur,
}) => {
return (
<input
id={id}
name={name}
type={type}
data-name={dataValue}
value={value ? value : ``}
autoComplete={autoComplete}
required
className={`relative ${display ? display : `flex`} ${
width ? width : `w-full`
} appearance-none ${padding} ${
bgStyles ? bgStyles : `bg-gray-200 dark:bg-slate-500`
} ${
borderStyles ? borderStyles : `border-gray-400 dark:border-slate-400`
} ${
textColor ? textColor : `text-zinc-600 dark:text-slate-300`
} ${borderRadius} border ${
placeHolderColor
? placeHolderColor
: `placeholder-zinc-600 dark:placeholder-slate-300`
} focus:z-10 focus:border-transparent focus:outline-none focus:ring-inset focus:ring-1 focus:ring-sky-500 dark:focus:ring-yellow-300 text-sm sm:text-base`}
placeholder={placeholder}
onChange={onChange}
onBlur={onBlur}
/>
);
};