Skip to content

Internal ID software / Forms

Textarea

Several lines of text.

Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/form.tsx. From the old system: Textarea in @id-identity-as/ui/form.

Example

Følger ordren, ikke fakturaen.

Følger ordren, ikke fakturaen.

import { Textarea } from '@/components/software/form';

<Textarea label="Besked til lageret" name="note" autoComplete="off" helper="Følger ordren, ikke fakturaen." />

Props

PropTypeDefaultWhat it does
label (required)stringThe visible label. Never a placeholder.
name (required)stringThe form field name.
autoComplete (required)AutoCompleteTokenAn HTML autocomplete token such as "email" or "organization", or "off" as the explicit refusal.
helperstringGuidance shown under the field when there is no error.
errorstringWhat to do about a problem. Its presence puts the field in its error state.
requiredbooleanRequired fields carry no mark. The optional ones are marked.
optionalLabelstring'(valgfrit)'The mark on an optional field. Pass a translation here.
rowsnumber4How many lines it shows before it scrolls.
...textareaTextareaHTMLAttributesEverything a native textarea takes.

Do

  • Say in the helper who reads the text.
  • Set rows to the amount of text you expect.

Do not

  • Do not use it for a single line. That is Input.

Accessibility

  • A native textarea with a real label, wired to its helper or its error like Input.

Tokens it uses

  • color.surface.base
  • color.text.default
  • color.neutral.500
  • color.software.muted
  • radius.sm
  • type.body.md
  • type.body.sm
  • type.heading.sm
  • space.inline.2
  • component.field.padding-top
  • component.field.padding-bottom
  • component.field.padding-x