Skip to content

Official government website An official website of the Federal Government of Nigeria

How you know
Federal Ministry of Communications, Innovation & Digital Economy Nigerian Design Standards

Textarea

Lets people type a longer answer over several lines, such as a message, a complaint or a description.

Updated

Live example

Textarea

Don't include your NIN, BVN or bank details

Controls
Property Control What it does
Default, active, error, disabled
Hint
Help text under the label
Required
Asterisk in the label row and native required
The question people answer

Overview

A textarea lets people write an answer that runs over several lines. It starts 5 lines tall and people can make it taller.

Use a textarea for

  • A message, a complaint or a description
  • Any answer that may run past one line
  • Free text with a character limit, shown in the hint

Don’t use a textarea for

  • Short answers like a name, email or phone number (use a text input)
  • A choice from a list (use radios, a select or a combo box)
  • Collecting NIN, BVN or bank details in free text

States and limits

A textarea starts 5 lines tall. With a character limit, the hint says so and counts down as people type.

Don't include your NIN, BVN or bank details

Default

Starts 5 lines tall (136px). People drag the corner to make it taller, up and down only.

Don't include your NIN, BVN or bank details

Active

2px border/dark while people type.

Error

The error message takes the hint’s place and the border turns red.

You have 446 characters remaining

With a character limit

The hint says the limit and counts down: “You have 446 characters remaining”.

Specifications

The properties of Form/Textarea field. The same in HTML, WordPress and React.

Textarea properties
Property Type Possible values Description
state string
  • default default
  • active
  • error
  • disabled
Active is the field in use: a 2px border/dark (not the keyboard focus ring). Error shows the message and a red border. Avoid disabled.
showHint boolean
  • true default
  • false
Help text under the label. Use it to say any character limit.
required boolean
  • false default
  • true
Shows an asterisk in the label row and sets the native required attribute. Use optional instead for “(optional)” when the field is not mandatory.
rows number
  • 5 default
Starting height: 5 lines (136px). People can drag it taller; it scrolls after about 12 lines.
maxLength number
  • none default
  • any number
Optional limit. Say it in the hint and count down as people type.

In code, use a <textarea> with a <label for>, CSS resize: vertical, and aria-describedby for the hint, countdown or error. Announce the countdown with aria-live="polite".

Tokens

Textarea tokens and contrast
Part Token Contrast on the page
Border border/strong, 1px 4.2:1
Border when active border/dark, 2px 14.3:1
Border in an error status/error/surface, 1px (2px when active) 4.9:1
Typed text text/primary, Body/medium (16px) 17.6:1
Disabled surface/muted fill, border/subtle, text/disabled Exempt
Size 136px tall (5 lines) to about 304px, then it scrolls; radius/050 —

Use cases

Do

Don't include your NIN, BVN or bank details

Use the hint to say what not to include, or the limit. People see it before they start writing.

Don’t

Don’t use a textarea for a short answer. A big box tells people to write a lot.

Layout

How the textarea is sized and how it grows.

Start at 5 lines
136px tall: 5 lines of 24px plus 8px padding top and bottom.
Grow up and down only
People drag the corner handle to make it taller. Never wider.
Scroll after about 12 lines
At about 304px the box stops growing and scrolls inside.
Fill the form column
On desktop it spans the 6 of 12 column form. On mobile it fills the width.
16px typed text
Keep the typed text at 16px on every screen, so iPhones don’t zoom in.

Copywriting

How to write the label, the hint and the messages.

Say what to write

“Your message”, “What happened?”, “Describe the problem”.

Say the limit up front

Put it in the hint: “You can enter up to 500 characters”.

Count down as people type

“You have 446 characters remaining”, then “You have 20 characters too many”.

Warn about sensitive details

“Don’t include your NIN, BVN or bank details”.

Say how to fix an error

“Enter your message”, or “Your message must be 500 characters or fewer”.

Keep what people wrote

After an error, keep the text so they only fix what’s wrong.

Examples

Textarea copywriting examples
Write Don’t write Why
Your message Comments Says what to write.
You can enter up to 500 characters Max 500 chars Plain words, before people start.
You have 20 characters too many Too long Says by how much.
Enter your message This field is required Says what to do.
Don’t include your NIN, BVN or bank details No sensitive info Names exactly what to leave out.

Accessibility

Built on a native <textarea> with a visible <label>, so it works with keyboards, screen readers and voice input.

Keyboard interaction for textareas
Key What it does
Tab Moves out of the textarea. It never adds a tab character.
Shift + Tab Moves back to the previous field.
Enter Adds a new line. It never submits the form.
  • The textarea has a visible label linked with for/id (WCAG 1.3.1, 3.3.2).
  • The character countdown is announced politely, without moving focus (WCAG 4.1.3).
  • The border is 4.2:1 and goes 2px when active (WCAG 1.4.11).
  • Text stays readable when zoomed to 200%; the box grows taller, never wider (WCAG 1.4.4, 1.4.10).
  • Errors use words and a red border, not colour alone (WCAG 1.4.1, 3.3.1).

For developers

Copy the code for HTML, WordPress or React from the Code tab in Live example. The options are listed under Specifications.

For designers

Use Form/Textarea field from 01 Library – Foundations. Don’t detach it.

References

Feedback

Report a problem with this page