Atomic Angular — Doc interne

Textarea

A native textarea wrapped like Input, with three height strategies and a rows-independent min/max bound for content-driven auto-sizing.

TextareaGroup is the multi-line sibling of InputGroup — same state model, same scheme palette, same counter typography — plus a resize strategy for how its height behaves.

Minimal example

A plain multi-line field
comment-field.component.ts
import { Component, signal } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { TextareaComponent, TextareaControlDirective } from "@sinequa/galactik";

@Component({
  selector: "comment-field",
  imports: [FormsModule, TextareaComponent, TextareaControlDirective],
  template: `
    <textarea-group>
      <textarea textarea-control rows="4" placeholder="Your message…" [(ngModel)]="comment"></textarea>
    </textarea-group>
  `,
})
export class CommentFieldComponent {
  readonly comment = signal("");
}

How it works

vertical none auto supported not supported (Firefox) resize height seeded by rows, user drags the handle height locked to rows supports field-sizing content? field-sizing: content, handle removed, rows ignored falls back to rows + drag handle min-height / max-height from minRows / maxRows

resize="auto" is a progressive enhancement: the CSS field-sizing: content property ships in Chrome/Edge 123+ and Safari 17.4+, but not in Firefox, so the drag handle is only removed inside an @supports guard — applying it unconditionally would leave Firefox with a box that neither grows nor can be dragged.

Recipes

Auto-sizing bounded by minRows/maxRows

rows has no effect once field-sizing: content applies, so minRows/maxRows exist precisely to bound an auto-sizing field — the sizing API that survives where rows no longer does.

One line by default, three at most, then scrolls
auto-sizing.html
<textarea-group resize="auto" [maxRows]="3">
  <textarea textarea-control rows="1" placeholder="Your message…"></textarea>
</textarea-group>

Options

Prop

Type

Pitfalls

What's next

On this page