Skip to main content
Version: 1.0.3

Textarea

The Textarea component is an enhanced version of the standard HTML textarea with beautiful animations and interactive features. Built with Framer Motion, it provides various animation variants, auto-expanding capabilities, and interactive effects.

Installation

ignix add component textarea

Usage

Import the component:

import AnimatedTextarea from '@ignix-ui/textarea';

Basic Usage

import { useState } from 'react';

function BasicTextarea() {
const [value, setValue] = useState('');

return (
<AnimatedTextarea
placeholder="Enter your message"
variant="clean"
value={value}
onChange={setValue}
/>
);
}

Props

PropTypeDefaultDescription
placeholderstringrequiredLabel text that floats above the textarea when active
variant'clean' | 'expandable' | 'smoothExpand' | 'glowBorder' | 'characterCount' | 'lineHighlight' | 'typewriterSound' | 'markdownPreview' | 'autoComplete' | 'syntaxHighlight' | 'rippleEffect' | 'gradientBorder' | 'neonGlow' | 'particleField' | 'elastic' | 'wave' | 'spotlight' | 'liquid' | 'cosmic' | 'hologram'requiredAnimation and visual style applied to the textarea
valuestringrequiredControlled value of the textarea
onChange(value: string) => voidrequiredCallback fired when the textarea value changes
onFocus() => voidundefinedCallback fired when the textarea gains focus
onBlur() => voidundefinedCallback fired when the textarea loses focus
disabledbooleanfalseDisables the textarea and applies reduced opacity
errorstringundefinedError message; turns border and label red when set
successbooleanundefinedApplies green border and label styling to indicate success
iconReact.ElementTypeundefinedIcon component rendered inside the left edge of the textarea
maxLengthnumber1000Maximum number of characters allowed
minRowsnumber3Minimum number of visible rows
maxRowsnumber10Maximum number of rows before scrolling kicks in
size'sm' | 'md' | 'lg''md'Controls padding, font size, and minimum height
showCharacterCountbooleanfalseDisplays a character counter badge in the bottom-right corner
autoResizebooleantrueAutomatically expands the textarea height as content grows
glowEffectbooleanfalseRenders a pulsing radial glow behind the textarea when focused
textareaClassNamestring""Additional Tailwind classes applied to the <textarea> element
labelClassNamestring""Additional Tailwind classes applied to the floating label
theme'light' | 'dark' | 'auto'undefinedReserved theme prop (accepted but not yet applied internally)