Allows users to enter and edit text.
import { RecoilRoot } from "recoil"; import { TextInput } from "@/ui/input/components/TextInput"; export const MyComponent = () => { const handleChange = (text) => { console.log("Input changed:", text); }; const handleKeyDown = (event) => { console.log("Key pressed:", event.key); }; return ( <RecoilRoot> <TextInput className label="Username" onChange={handleChange} fullWidth={false} disableHotkeys={false} error="Invalid username" onKeyDown={handleKeyDown} RightIcon={null} /> </RecoilRoot> ); };
Text input component that automatically adjusts its height based on the content.
import { RecoilRoot } from "recoil"; import { AutosizeTextInput } from "@/ui/input/components/AutosizeTextInput"; export const MyComponent = () => { return ( <RecoilRoot> <AutosizeTextInput onValidate={() => console.log("onValidate function fired")} minRows={1} placeholder="Write a comment" onFocus={() => console.log("onFocus function fired")} variant="icon" buttonTitle value="Task: " /> </RecoilRoot> ); };
Displays a pair of text inputs side by side, allowing the user to edit two related values simultaneously.
import { RecoilRoot } from "recoil"; import React, { useState } from "react"; import { EntityTitleDoubleTextInput } from "@/ui/input/components/EntityTitleDoubleTextInput"; export const MyComponent = () => { const [firstValue, setFirstValue] = useState( "First Value" ); const [secondValue, setSecondValue] = useState( "Second Value" ); const handleInputChange = (newFirstValue, newSecondValue) => { setFirstValue(newFirstValue); setSecondValue(newSecondValue); }; return ( <RecoilRoot> <EntityTitleDoubleTextInput firstValue={firstValue} secondValue={secondValue} firstValuePlaceholder="Enter First Value" secondValuePlaceholder="Enter Second Value" onChange={handleInputChange} /> </RecoilRoot> ); };
Allows you to create multi-line text inputs.
import { TextArea } from "@/ui/input/components/TextArea"; export const MyComponent = () => { return ( <TextArea disabled={false} minRows={4} onChange={()=>console.log('On change function fired')} placeholder="Enter text here" value="" /> ); };
As an open-source company, we welcome contributions through Github. Help us keep it up-to-date, accurate, and easy to understand by getting involved and sharing your ideas!