Skip to content

docs: document heading-based steps syntax and tocDepth prop#3661

Merged
fern-support merged 4 commits into
mainfrom
devin/1771360401-steps-tocdepth-docs
Feb 17, 2026
Merged

docs: document heading-based steps syntax and tocDepth prop#3661
fern-support merged 4 commits into
mainfrom
devin/1771360401-steps-tocdepth-docs

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Feb 17, 2026

Summary

Documents three previously undocumented aspects of the <Steps> component:

  1. Markdown heading syntax: Users can define steps using ## or ### headings inside <Steps> instead of explicit <Step> components. This syntax already works but was not documented.
  2. TOC depth from heading level: When using toc={true} with heading-based steps, the heading level now determines the depth at which steps appear in the table of contents (e.g., ### headings nest under ## headings). This behavior is being added in the companion PR fern-api/fern-platform#7157.
  3. tocDepth prop: New property on <Steps> that controls the depth at which steps appear in the table of contents. Automatically set when using heading-based syntax; can be set manually when using explicit <Step> components.

Changes are scoped to a single file: fern/products/docs/pages/component-library/default-components/steps.mdx.

Updates since last revision

  • Replaced all uses of the "TOC" abbreviation with "table of contents" to pass vale lint checks.
  • Added tocDepth prop documentation as a new <ParamField> under <Steps> properties, with a code example showing manual usage with explicit <Step> components.
  • Added expanded description to the toc prop explaining how heading levels affect table of contents nesting.

Review & Testing Checklist for Human

  • Verify tocDepth can actually be set by users on <Steps> — the prop is documented as user-facing, but in fern-platform it's primarily set internally by the rehype-steps plugin. Confirm that <Steps toc={true} tocDepth={2}> with explicit <Step> children actually produces depth-2 entries in the table of contents. The toc.ts code reads the attribute regardless of source, so this should work, but it hasn't been tested end-to-end.
  • Docs claim tocDepth accepts values 1, 2, or 3 — the rehype-steps plugin caps at 3, but toc.ts does a raw parseInt with no upper/lower bound validation. A user setting tocDepth={5} or tocDepth={0} would pass through unclamped. Decide if the docs should mention this or if the platform code should add validation.
  • Coordinate merge order with fern-platform#7157 — the tocDepth behavior documented here depends on that PR being merged first. Merging docs first would document behavior that doesn't exist yet.
  • No live rendering example for heading syntax — unlike other variants ("Steps with titles", etc.), the new "Steps with markdown headings" section only has code blocks, not a highlight-frame live demo. Decide if a live example should be added for consistency.

Suggested test plan: After merging fern-platform#7157, check the preview deployment and verify (1) the code examples render as syntax-highlighted blocks (not live headings), (2) the tocDepth ParamField renders correctly with its nested code example, and (3) the page table of contents looks sensible.

Notes

Co-Authored-By: paarth@buildwithfern.com <paarth@buildwithfern.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

</Steps>
```

When using `toc={true}` with heading-based steps, the heading level determines how steps appear in the table of contents. For example, `##` headings appear at depth 2 in the TOC (nested under any `#` headings), while `###` headings appear at depth 3 (nested under `##` headings).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'TOC' has no definition.

<ParamField path="toc" type="boolean" required={false}>
Whether to include the steps in the table of contents. Defaults to `false`.

When using markdown headings inside `<Steps>`, the heading level (e.g., `##` or `###`) determines the depth at which steps appear in the TOC. This lets you control the nesting hierarchy of steps in the table of contents by choosing the appropriate heading level.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'TOC' has no definition.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 17, 2026

devin-ai-integration Bot and others added 2 commits February 17, 2026 20:42
…lint

Co-Authored-By: paarth@buildwithfern.com <paarth@buildwithfern.com>
Co-Authored-By: paarth@buildwithfern.com <paarth@buildwithfern.com>
@devin-ai-integration devin-ai-integration Bot changed the title docs: document heading-based steps syntax and TOC depth behavior docs: document heading-based steps syntax and tocDepth prop Feb 17, 2026

### Steps with markdown headings

You can also define steps using markdown headings instead of the `<Step>` component. Place `##` or `###` headings directly inside `<Steps>` and they are automatically converted into step titles with anchor links.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'they're' instead of 'they are'.

@fern-support fern-support merged commit 7966572 into main Feb 17, 2026
2 checks passed
@fern-support fern-support deleted the devin/1771360401-steps-tocdepth-docs branch February 17, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants