-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextField.tsx
More file actions
37 lines (34 loc) · 987 Bytes
/
TextField.tsx
File metadata and controls
37 lines (34 loc) · 987 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
33
34
35
36
37
import { TextField } from "@mui/material";
import { useState } from "react";
export interface TextFieldComponentProps {}
/**
* Ui component showcasing the useState hooks usage.
*
* @param props TextField props
* @returns Ui component
*/
export default function TextFieldComponent(props: TextFieldComponentProps) {
const [textFieldValue, setTextFieldValue] = useState("");
const handleEdit = (e: any) => {
setTextFieldValue(e.target.value);
};
return (
<div className="grid grid-cols-3 grid-flow-row gap-2 ">
<div className="m-5">
<TextField
label="Name"
variant="outlined"
fullWidth
value={textFieldValue}
onChange={handleEdit}
/>
</div>
<div className=" m-4 p-4 rounded-md text-lg text-end text-sky-800">
Text display:
</div>
<div className=" m-4 p-4 rounded-md border shadow-lg text-lg text-sky-800">
{textFieldValue}
</div>
</div>
);
}