forms

Tailwind CSS Textarea

A textarea is a multi-line text input field that allows users to enter longer text.

Class Name
Type
Description
textareaComponentBasic textarea field.
textarea-floatingComponentFloating textarea field.
textarea-floating-labelPartFloats the label to the top.
label-textPartFor label.
helper-textPartFor helper text.
is-validStateAdds success style to the input.
is-invalidStateAdds error style to the input.
textarea-xsSizeExtra small Textarea size.
textarea-smSizeSmaller Textarea size.
textarea-mdSizeMedium(default) Textarea size.
textarea-lgSizeLarger Textarea size.
textarea-xlSizeExtra large Textarea size.

Basic textarea example.

Basic textarea with placeholder.

The textarea-floating style is used to define the appearance of the textarea, while the textarea-floating-label is the container for the label text.

Add responsive class textarea-{size} where {size} = xs|sm|md|lg|xl for textarea of different sizes.

Add responsive class select-{size} where {size} = xs|sm|md|lg|xl for select of different sizes.

Add a leading icon inside textarea.

Add a tailing icon inside textarea.

Success state can be show using is-valid class.

Error state can be show using is-invalid class.

label elements hidden using the .sr-only class.

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

Add the readonly boolean attribute on an textarea to prevent modification of the textarea value.

Basic textarea example with helper text and hints.