TextArea
A flexible textarea component with auto-resize, character counting, and validation support.
Basic Usage
Basic TextArea
import { TextArea } from 'fluxo-ui';
function MyComponent() {
const [value, setValue] = useState('');
return (
<TextArea
label="Description"
placeholder="Enter your description..."
value={value}
onChange={(e) => setValue(e.target.value)}
/>
);
}With Character Limit
TextArea with Character Limit
<TextArea
label="Bio"
placeholder="Tell us about yourself..."
value={value}
onChange={(e) => setValue(e.value)}
maxLength={150}
/>Auto Resize
Auto-resizing TextArea
<TextArea
label="Comments"
placeholder="Start typing and watch it grow..."
value={value}
onChange={(e) => setValue(e.target.value)}
autoResize
rows={2}
/>Row Heights
Different Row Heights
<TextArea label="Short (2 rows)" rows={2} placeholder="2 rows high" />
<TextArea label="Medium (4 rows)" rows={4} placeholder="4 rows high" />
<TextArea label="Tall (8 rows)" rows={8} placeholder="8 rows high" />States
TextArea States
This field is required
<TextArea label="Normal" placeholder="Normal state" value={value} onChange={(e) => setValue(e.value)} />
<TextArea label="Disabled" placeholder="Disabled state" value={value} onChange={(e) => setValue(e.value)} disabled />
<TextArea label="Read Only" value="This is read-only content" readonly onChange={(e) => setValue(e.value)} />
<TextArea label="Required" placeholder="Required field" value={value} onChange={(e) => setValue(e.value)} required />
<TextArea label="With Error" error="This field is required" value={value} onChange={(e) => setValue(e.value)} />Import
import { TextArea } from 'fluxo-ui';Props
valuestringCurrent value of the textarea (controlled)
valuestringCurrent value of the textarea (controlled)
placeholderstringPlaceholder text
placeholderstringPlaceholder text
labelstringLabel text
labelstringLabel text
errorstring | booleanError message string (also marks invalid). Pass `true` to mark invalid without a message
errorstring | booleanError message string (also marks invalid). Pass `true` to mark invalid without a message
invalidbooleanForce the field into an invalid state without an error message
invalidbooleanForce the field into an invalid state without an error message
helperTextReactNodeHelper text rendered under the input and linked via aria-describedby
helperTextReactNodeHelper text rendered under the input and linked via aria-describedby
disabledbooleanfalseDisable the textarea
disabledbooleanfalseDisable the textarea
readonlybooleanfalseMake the textarea read-only
readonlybooleanfalseMake the textarea read-only
requiredbooleanfalseMark the textarea as required
requiredbooleanfalseMark the textarea as required
autoFocusbooleanfalseAuto focus the textarea on mount
autoFocusbooleanfalseAuto focus the textarea on mount
rowsnumber3Number of visible rows
rowsnumber3Number of visible rows
autoResizebooleanfalseAuto resize height based on content
autoResizebooleanfalseAuto resize height based on content
maxHeightstring"200px"Maximum height for auto-resizing
maxHeightstring"200px"Maximum height for auto-resizing
maxLengthnumberMaximum character limit
maxLengthnumberMaximum character limit
minLengthnumberMinimum character requirement
minLengthnumberMinimum character requirement
idstringUnique identifier for the textarea
idstringUnique identifier for the textarea
namestringName attribute for the textarea
namestringName attribute for the textarea
onChangefunctionChange event handler
onChangefunctionChange event handler
classNamestringAdditional CSS classes
classNamestringAdditional CSS classes
Features
Auto Resize
Expands vertically as the user types, up to an optional maxHeight
Character Counter
Shows remaining characters when maxLength is set
Row Control
Set the initial visible height with the rows prop
Validation States
Supports error messages, required marking, disabled and readonly modes
Accessibility
Proper label association, aria-required, aria-invalid and aria-describedby wiring
Theming
Full dark/light + 5 brand themes via CSS variables — zero extra config