0.0.17 • Published 1 year ago
custom-input-text v0.0.17
React + Next js + TypeScript + Vite + Tailwind CSS
const [name, setName] = useState<string>("");
const [price, setPrice] = useState<number>();
const [catgeory, setCatgeory] = useState<string>("");
<InputText
labelText="Name"
placeholder="Enter your Name"
htmlFor="name"
value={name}
onChange={setName}
/>
<InputNumber
labelText="Price"
placeholder="Enter your Price"
htmlFor="price"
value={price}
onChange={setPrice}
/>
<InputOption
labelText="Catgeory"
htmlFor="catgeory"
value={catgeory}
onChange={setCatgeory}
options={} // map value
/>
container="" // optional style parent div
labelClass="" // optional style label
inputClass="" // optional style input