docs: document heading-based steps syntax and tocDepth prop#3661
Merged
Conversation
Co-Authored-By: paarth@buildwithfern.com <paarth@buildwithfern.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| </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). |
Contributor
There was a problem hiding this comment.
📝 [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. |
Contributor
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'TOC' has no definition.
Contributor
|
🌿 Preview your docs: https://fern-preview-298206d8-c3f0-48e8-8681-79d4d6a54ad1.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
…lint Co-Authored-By: paarth@buildwithfern.com <paarth@buildwithfern.com>
Co-Authored-By: paarth@buildwithfern.com <paarth@buildwithfern.com>
devalog
approved these changes
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. |
Contributor
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'they're' instead of 'they are'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents three previously undocumented aspects of the
<Steps>component:##or###headings inside<Steps>instead of explicit<Step>components. This syntax already works but was not documented.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.tocDepthprop: 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
tocDepthprop documentation as a new<ParamField>under<Steps>properties, with a code example showing manual usage with explicit<Step>components.tocprop explaining how heading levels affect table of contents nesting.Review & Testing Checklist for Human
tocDepthcan 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. Thetoc.tscode reads the attribute regardless of source, so this should work, but it hasn't been tested end-to-end.1,2, or3— the rehype-steps plugin caps at 3, buttoc.tsdoes a rawparseIntwith no upper/lower bound validation. A user settingtocDepth={5}ortocDepth={0}would pass through unclamped. Decide if the docs should mention this or if the platform code should add validation.tocDepthbehavior documented here depends on that PR being merged first. Merging docs first would document behavior that doesn't exist yet.highlight-framelive 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
tocDepthParamField renders correctly with its nested code example, and (3) the page table of contents looks sensible.Notes