default (plain textarea) and edit (rich text editor with Tiptap).
The
edit mode requires Tiptap dependencies to be installed in your project:Default Mode
Basic multi-line text input with character counter:With Character Limit
Rich Text Editor Mode
Usetype="edit" for formatted text editing with toolbar:
Rich Text Editor with Custom Toolbar Button
Design Variants
Primary Design (Default)
Gray background without border:Secondary Design
White background with border:Props
Common Props (Both Types)
The type of textarea:
default: Plain textarea with optional character counteredit: Rich text editor with formatting toolbar (requires Tiptap)
Placeholder text displayed when empty.
Custom styles for the container.
Visual design variant:
primary: Gray background without bordersecondary: White background with border
Maximum character length. Shows character counter when set (default mode only).
Default Mode Props
Initial value for uncontrolled component.
Name attribute for form submission.
Callback fired when the value changes.
Edit Mode Props
HTML content for controlled component (edit mode).
Callback fired when content changes. Receives HTML string (edit mode).
Custom button displayed in the top-right of the toolbar (edit mode only).
Rich Text Editor Features
Theedit mode includes a toolbar with the following formatting options:
- Text Styles: Paragraph, Heading 1, Heading 2
- Text Formatting: Bold, Italic, Underline
- Text Alignment: Left, Center, Right
StarterKit: Basic editing functionalityTextAlign: Text alignment supportTextStyleKit: Text styling capabilitiesPlaceholder: Placeholder text support
Styling Notes
- Default mode has a fixed height of 100px (can be overridden with
style) - Edit mode height should be set via the
styleprop (defaults to container height minus toolbar) - Custom scrollbar styling in default mode
- Both modes support focus states with border color changes