Props table
A reference for a component's props or a function's options, built as a definition list rather than a grid.
- #authoring
- #components
- #reference
The reference block at the end of a component note. Two columns carry what a
reader scans — the name and a short type — and each row holds the rest until it
is opened. A reader arrives looking for one prop, such as defaultOpen, rather
than comparing four columns, and a long union or a callback signature would
otherwise widen the type column for every other row.
<Callout />
type?note | tip | warning | danger | important
Which notice to show. info and caution are accepted as aliases.
- Default
note
title?string
Replaces the default heading for the chosen type.
compact?boolean
Renders on one line without a heading.
- Default
false
Required and optional
A name prints with a question mark unless its row sets required, the way
TypeScript writes it, and a row with a default shows it when opened. Between
them a reader can tell what they must pass from what they may:
loadEntry(options)
slugstring
Path from the content root, without a leading slash.
includeDrafts?boolean
Return the entry even when its frontmatter marks it a draft.
- Default
false
compile?boolean
Compile the MDX body. Pass false when only metadata is wanted.
- Default
true
Signatures
A function-typed prop names its shape in the row and keeps the signature inside, with its parameters and what it returns:
useDebounce(value, options)
onSettled?function
Called once the value stops changing.
- Type
(value: string, elapsed: number) => void- Parameters
value— The value that settled.elapsed— Milliseconds waited before it did.
- Returns
- Nothing. Throwing here is left to the caller.
leading?boolean
Fire on the first change as well as the last.
- Default
false
Rich descriptions
A rows description is plain text. When a prop needs more than a sentence,
write the row as a <Prop> child and the description becomes MDX, the way a
JSDoc comment is written:
<Callout />
type?string
Which notice to show. info and caution are accepted as aliases, so a
note carried over from another site keeps rendering.
- Default
note
compact?boolean
Renders on one line without a heading. Use it for an aside that would otherwise outweigh the paragraph it belongs to.
- Default
false
The attributes are a row's, minus description. A table takes rows, <Prop>
children, or both.
Writing the rows
Keep a rows description to one sentence about what the prop does; the name
and type already render as code. Anything that needs an example or a caveat
belongs either in a <Prop> body or in the prose above, where it can have a
heading of its own.
Props
<PropsTable />
of?string
What is being documented, e.g. "<Callout />". Shown as the heading.
rowsPropRow[]
One object per prop. Only name is required; a row with nothing beyond a type renders as a plain line.
- Type
Array<{ name: string; type?: string; typeDetail?: string; parameters?: { name: string; description?: string }[]; returns?: string; default?: string; required?: boolean; description?: string }>
Related entries
Callouts
Semantic notices for a caveat, a tip or a danger, with the five types and when each is honest.
Steps
A numbered procedure whose rail survives the code blocks inside it.
Tabs
One panel per alternative, with keyboard navigation and a shared choice across the document.