Skip to content

Props table

Pro

A component's props as a table: name, type, default and description, for documentation. Not an M3 component (@windmorph/react-pro).

import { PropsTable } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Keyboard

Props table keyboard
KeyAction
TabMoves to the table, which takes focus so it can be scrolled.
Arrow Left or Arrow RightScrolls a table wider than its space sideways.

Screen reader

Role
A region around a real <table> with a <caption>. Column headings are th with scope="col", and each row starts with the prop name as a th with scope="row", so table navigation reads each cell with its column and its prop.
Accessible name
The region and the table are both named by caption, or labels.caption ("Properties"). The caption is visually hidden.
States announced
A required prop is followed by the word "required" (labels.required); the asterisk you see is hidden.

Focus

  • The scroll region takes focus with Tab (WCAG 2.1.1), so a keyboard can scroll it. It shows the M3 focus indicator: a 3px secondary outline 2px outside its border.
  • The table holds nothing else to focus.

Touch target

None. It has nothing to press; the region scrolls with a swipe.

Motion

None. Nothing in it moves.

What you need to do

  • Give each table a caption that says whose props it lists ("Button props"), so regions on a page with several tables have different names.
  • Keep descriptions plain text, and pass labels to translate the headings and the word "required".