1. Components
  2. Textarea

Basic Forms

Tailwind CSS Textarea

A textarea is an element on a webpage that you can type into.

Attention needed

By default Preline UI uses Tailwind CSS Forms plugin. Don't forget to install it!

Placeholder

Basic input example with placeholder.

Theme:

Label

Basic input example with label.

Theme:

Hidden label

<label> elements hidden using the .sr-only class

Theme:

Basic

Basic input example.

Theme:

Gray input

Gray textarea variant.

Theme:

Underline input

Underline textarea variant.

Theme:

Floating label

A placeholder is required on each <input> as our method uses the :placeholder-shown pseudo-element. Also note that the <input> must come first so we can utilize a sibling selector (e.g., ~).

Theme:

Default height with autoheight script

Use data-hs-default-height="*" to set the height of the textarea while maintaining the auto-height feature. Ensure to include the rows="1" attribute as well.

Theme:

Sizes

Inputs stacked small to large sizes.

Theme:

Readonly

Add the readonly boolean attribute on an input to prevent modification of the input’s value.

Theme:

Disabled

Add the disabled boolean attribute on an input to remove pointer events, and prevent focusing.

Theme:

Helper text

Basic input example with helper text.

Theme:

Corner hint

Basic input example with corner-hint.

Theme:

Autoheight

Autoheight example.

Theme:

Basic usage in modal window.

Textarea examples

Advanced custom examples.

Theme:

Validation states

It provides valuable, actionable feedback to your users with HTML5 form validation.

Theme:

Destroy and Reinitialize

Provides destroy method that helps to destroy a textarea autoheight.

Theme: