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.

Purpose

A props table documents a component's API: each prop's name, type, default and description, one row each. It is not an M3 component, so it comes from @windmorph/react-pro. It is built for documentation and is deliberately not a data table: there is no sorting, selection or paging. For data people work with, build a table of your own.

Generate the rows from your components' types at build time, so the table never drifts from the code. It renders on the server and ships no script of its own.

Behaviour

  • On a narrow screen the table keeps its columns (at least 512px) and scrolls sideways inside its rounded border, never the page.
  • Names, types and defaults show as code, always left to right; a required prop has an asterisk.

When not to use

For data people sort, select or page through, build a data table; this one only documents an API.

See also

  • Code block: Source code for documentation, highlighted at build time, with a copy button and optional line numbers. Not an M3 component (@windmorph/react-pro).