Raw
1 import { useState } from "react"
2 import { Textarea } from "@medusajs/ui"
3
4 export default function TextareaControlled() {
5 const [value, setValue] = useState("")
6 return (
7 <div className="flex flex-col gap-y-2">
8 <Textarea
9 value={value}
10 onChange={(e) => setValue(e.target.value)}
11 placeholder="Write your feedback..."
12 aria-label="Feedback"
13 />
14 <div className="text-ui-fg-muted txt-compact-small">
15 {value.length} characters
16 </div>
17 </div>
18 )
19 }