Forms

Textarea

@xui/textarea

A styled native <textarea>. ngModel/formControl, validation and the invalid-and-touched error styling all come from Angular's own textarea support — the directive only dresses it and, with autoResize, grows it.

Install

pnpm add @xui/textarea

Add the barrel to a standalone component's imports:

import { XuiTextareaImports } from '@xui/textarea';

@Component({
  imports: [XuiTextareaImports],
  // …
})

Examples

Default

Loading preview…

Small

Loading preview…

Auto resize

Loading preview…

API

XuiTextarea

directivetextarea[xuiTextarea]

Styles a native <textarea> and, on request, grows it to fit its content.

Variants

AxisOptionsDefaultsizemdsmlgmdresizetruefalsetrue

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the variant classes.''sizeXuiTextareaVariants['size']Padding and font size, from the shared control scale, so the box matches an input of the same size.this.config.sizeautoResizebooleanGrow to fit the content instead of scrolling; disables manual resize.false

Methods

resize(): voidPin the height to the content. Public so a consumer can call it after setting the value in code.

Source

libs/ui/textarea/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.