Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 04 Fields

Textarea

The multi-line twin of the text field: the same label, hint and error, with room for a few lines. The reader can make it taller.

Use it in Angular
import { TextareaComponent } from '@okaapi-ui/angular';
// Works with formControlName, [formControl] and ngModel.
Works with

With a hint

Gate code, floor, anything the driver should know.

Angular
<ui-textarea
  label="Delivery notes"
  hint="Gate code, floor, anything the driver should know."
  [rows]="4"
  formControlName="notes"
/>

With an error

Same rules as the text field: the message is announced, and the border thickens, so colour is never the only sign.

Angular
<ui-textarea
  label="Reason for the refund"
  formControlName="reason"
  [error]="form.controls.reason.invalid ? 'Tell us what went wrong' : undefined"
/>

In Arabic

كود البوابة، الدور، أي حاجة السواق محتاج يعرفها.

Angular
<!-- dir="rtl" on the page or any ancestor -->
<ui-textarea label="ملاحظات التوصيل" hint="كود البوابة، الدور، أي حاجة السواق محتاج يعرفها." />

When to use something else

If you needUse
One line of textText field

Inputs

NameTypeDefaultWhat it does
labelstring — Required. The visible label, tied to the textarea.
rowsnumber3Height in lines. The reader can still make it taller.
maxlengthnumber — The most characters it accepts.
hintstring — Help text under the textarea, read with it.
errorstring — The translated error. Marks the textarea invalid and announces the message.
testIdstring — data-testid on the textarea, for tests.

Keyboard and screen readers

  • The same label, hint and error as the text field, all read with it.