Brand Guide

Components

Repeatable rows

A list of fields that a person can add to and remove from, such as skills or languages.

Default

Skills

Starting with one empty row

A lone empty row has no remove button, and its field runs the full width. The button appears once the row has a value or there is a second row. Add another appears once every row is filled.
Which cities would you consider?

Two fields per row

RepeatableRowsHeader puts column labels above the rows, and each field is named by its label. Below 640px the fields stack and the labels hide, but still name the fields.

Row error

An error sits under the row it is about.
Links

Best practices

  • Each row is ordinary fields with a remove button at its end. One button under the list adds the next row.
  • Name every field. With one field per row, the legend names the group and each input takes an aria-label such as "City 2". With two fields per row, each takes aria-labelledby pointing at its column label.
  • An error belongs to its row. Pass it as error on the row, and set aria-invalid on the field it is about.
  • When a list starts with one empty row, hide that row's remove button with isRemovable until there is something to remove. Leave it on in two-field rows, so the fields stay under their column labels.
  • When adding hides the add button, or removing takes away the button that was pressed, move focus into a row's input so it is not lost.