-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathInput.jsx
More file actions
32 lines (30 loc) · 922 Bytes
/
Input.jsx
File metadata and controls
32 lines (30 loc) · 922 Bytes
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
import React from "react";
const Input = ({
register,
placeholder = null,
type = "text",
defaultValue = null,
hasAutoComplete = true,
onKeyDown = () => null,
min = null,
value = undefined,
readOnly = false,
disabled = false
}) => {
return (
<input
className="shadow appearance-none border w-full py-2 px-3 text-black"
placeholder={placeholder}
{...register}
type={type}
onKeyDown={onKeyDown}
autoComplete={hasAutoComplete ? "on" : "off"}
defaultValue={defaultValue}
min={min}
value={value}
readonly={readOnly}
disabled={disabled}
/>
)
}
export default Input;