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.

Props

PropsTable 7 props

  • rowstype PropsTableRow[]Required

    The props, one row each, in order.

  • captiontype stringdefault labels.caption ("Properties")

    Names the scrollable region and the table; visually hidden. Wins over labels.caption.

  • reftype Ref<HTMLDivElement>

    Ref to the root element (the scroll region). Its other props (id, aria-*, data-*) go to it too.

Text

  • labelstype Partial<PropsTableLabels>

    The caption, column headings and required note, merged over the English defaults.

Also accepts the root element's HTML attributes (id, data-*, event handlers).

Spec status

Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.

  • A component's props, with required and default values

    Built

    Use case · Basic

  • Translated caption and headings (labels)

    Built

    Configuration · Labels

M3 Expressive specs

Shape
rounded-corner-medium

Rows and styling

  • Each row is a PropsTableRow: name, type, and optionally defaultValue, description (plain text) and required. Names must be unique.
  • className and style go on the scroll region, the outermost element; classNames styles the table, its head, rows, header and data cells, and each column's cells.
  • It has no tokens of its own: surface with outline-variant borders and medium corners, and its root carries data-tokens="wm-props-table".
  • labels holds the caption, the four column headings and the word read after a required prop; caption wins over labels.caption.