Skip to main content

A fully accessible textarea component built with native HTML elements and Tailwind CSS. Capture multi-line text input for forms, comments, and content creation with custom sizing, error states, and character count support. Theme-aware styling with label integration for accessible forms.

Textarea components capture multi-line text input from users, perfect for messages, comments, descriptions, and long-form content. Built with native HTML textarea elements and enhanced with Tailwind CSS styling, textareas support multiple sizes, colors, and states. Accessible and fully customizable, they integrate seamlessly into forms and communication interfaces.

Class Type Description
textareaBaseStyled multi-line text input
textarea-softStyleMuted tinted background
textarea-ghostStyleNo visible border until focused
textarea-dashedStyleDashed border style
textarea-xsSizeExtra small
textarea-smSizeSmall
textarea-mdSizeMedium (default)
textarea-lgSizeLarge
textarea-xlSizeExtra large
textarea-2xlSize2× extra large
textarea-primaryColorPrimary theme color border
textarea-secondaryColorSecondary theme color border
textarea-accentColorAccent theme color border
textarea-neutralColorNeutral theme color border
textarea-infoColorInfo semantic color border
textarea-successColorSuccess semantic color border
textarea-warningColorWarning semantic color border
textarea-errorColorError semantic color border

Basic Usage

<textarea class="textarea" placeholder="Enter your message here..."></textarea>
<textarea className="textarea" placeholder="Enter your message here..."></textarea>

Textarea Sizes

html
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<textarea class="textarea textarea-xs" placeholder="Extra Small"></textarea>

<textarea class="textarea textarea-sm" placeholder="Small"></textarea>

<textarea class="textarea textarea-md" placeholder="Medium"></textarea>

<textarea class="textarea textarea-lg" placeholder="Large"></textarea>

<textarea class="textarea textarea-xl" placeholder="Extra Large"></textarea>

<textarea class="textarea textarea-2xl" placeholder="2X Large"></textarea>

Textarea Colors

html
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<textarea class="textarea" placeholder="Default"></textarea>

<textarea class="textarea textarea-primary" placeholder="Primary"></textarea>

<textarea class="textarea textarea-secondary" placeholder="Secondary"></textarea>

<textarea class="textarea textarea-accent" placeholder="Accent"></textarea>

<textarea class="textarea textarea-info" placeholder="Info"></textarea>

<textarea class="textarea textarea-success" placeholder="Success"></textarea>

<textarea class="textarea textarea-warning" placeholder="Warning"></textarea>

<textarea class="textarea textarea-error" placeholder="Error"></textarea>

Textarea Styles

html
1
2
3
4
5
6
7
<textarea class="textarea" placeholder="Default style"></textarea>

<textarea class="textarea textarea-soft" placeholder="Soft style"></textarea>

<textarea class="textarea textarea-dashed" placeholder="Dashed style"></textarea>

<textarea class="textarea textarea-ghost" placeholder="Ghost style"></textarea>

Disabled Textarea

html
1
2
3
<textarea class="textarea" placeholder="Enabled textarea"></textarea>

<textarea class="textarea" placeholder="Disabled textarea" disabled></textarea>

Textarea with Label

html
1
2
3
4
<label>
  <span>Your feedback</span>
  <textarea class="textarea w-full" placeholder="Share your thoughts..."></textarea>
</label>

Textarea with Character Count

html
1
2
3
4
5
<label>
  <span>Write a message (max 200 characters)</span>
  <textarea class="textarea w-full" placeholder="Type here..." maxlength="200"></textarea>
  <span>Characters remaining</span>
</label>

Advanced Markdown Editor

Use markdown-text-editor to turn any textarea into a full markdown editor. Two modes are available: plain (raw Markdown syntax) and hybrid (renders formatting live as you type). For more configuration options see the plugin docs.

Plain Mode

Displays raw Markdown syntax. Users write Markdown directly in the textarea.

<textarea id="plain-markdown-editor" name="content"></textarea>
1
2
3
import MarkdownEditor from "markdown-text-editor";

new MarkdownEditor('#plain-markdown-editor');

Hybrid Mode

Renders formatting live as you type — bold, headings, lists, and more appear styled inline.

<textarea id="hybrid-markdown-editor" name="content"></textarea>
1
2
3
import MarkdownEditor from "markdown-text-editor";

new MarkdownEditor('#hybrid-markdown-editor', { mode: 'hybrid' });