Textarea

A Textarea component is an input field that allows users to enter multi-line text. It provides a larger area for text input compared to a standard text input field, making it ideal for comments, feedback, or any scenario where users need to provide detailed information. Textareas can be resized, styled, and configured to support features like character limits, placeholders, and auto-resizing to enhance user experience.
# Demo
# Attributes
NameTypeDefaultDetails
classNamestring' 'You can customise by passing tailwind classes.
labelClassNamestring' 'You can customise by passing tailwind classes.
textareaClassNamestring' 'You can customise by passing tailwind classes.
idstringtextareaYou can pass id to create unique identifier.
labelstring' 'You can pass label of the textarea.
placeholderstring' 'You can pass placeholder of the textarea.
valuestring' 'You can pass value of the textarea.
disabledbooleanfalseYou can pass disabled to set default textarea state.
onChange(value: string | number) => voidRequiredYou can get callback when textarea value changed.
# Usage
import { useState } from 'react'; import { NTextarea } from 'nayan'; const Textarea = () => { const [address, setAddress] = useState('Bangalore, India'); return ( <NTextarea id="ta1" label="Address" placeholder="Enter address" className="mb-3" rows={3} value={address} onChange={e => setAddress(e.target.value)} /> ); }; export default Textarea;