DocumentationDescriptioncomponent
DocumentationDescription({ description, default: def, optional, readonly }: DocumentationDescriptionProps): ReactNode| Param | Type | |
|---|---|---|
props | DocumentationDescriptionProps | Props for DocumentationDescription — a description cell's resolved text, plus an optional default/optionality note. required |
.description | string | Already-resolved description text (hand-written, or fallen back to the referenced type's own description), rendered as inline markup. readonly |
.default | string | Default-value expression — rendered as a trailing Defaults to … note (linked when it's a documented token). readonly |
.optional | boolean | Whether the value is optional — pass an explicit boolean to opt into the note: false appends Required. (when there's no default), true appends nothing. Leave undefined to suppress the note entirely (e.g. for returns/throws). readonly |
.readonly | boolean | Whether the value is read-only — appends a trailing Readonly note at the very end (after any Defaults to … / Required.). readonly |
| Return | |
|---|---|
ReactNode | The description and any trailing notes wrapped in a <Prose>, or null when all are empty. |
Render a documentation table row's description cell.
- The description is parsed as inline markup via
TreeMarkup(context="inline"), so backticks, emphasis and links resolve rather than showing as literal source — and each inline-code span auto-links to its documented token when one exists. - When a
defaultis given it renders a trailingDefaults to …note on the same line (linking the value when it's a documented token); otherwise, whenoptionalis explicitlyfalse, it renders arequired<Tag>. (Optionality has no tag — it's implicit, and an optional value usually carries the longerDefaults to …text instead.) - When
readonlyis set, areadonly<Tag>is appended at the very end (after any default/required note). - Wrapped in
<Prose>so markup-produced<code>(and other inline) elements pick up the standard prose typography (the chip background, etc.) — a bare<code>is only styled inside a.proseancestor.
Examples
<DocumentationDescription description="The `foo` value." optional={false} readonly />