Skip to content

Commit f118694

Browse files
devin-ai-integration[bot]fern-api[bot]devalog
authored
docs: document layout.mobile-toc site-level setting (#5013)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent a7325bb commit f118694

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
tags: ["navigation", "configuration", "docs.yml"]
3+
---
4+
5+
## Mobile table of contents bar
6+
7+
Pages using the [`guide` and `overview` layouts](/learn/docs/configuration/page-level-settings#layout) can now display a sticky table of contents bar below the header on mobile and tablet viewports. The bar shows a scroll progress indicator and the current heading, and expands to the full table of contents when tapped.
8+
9+
<Frame>
10+
<video
11+
autoPlay
12+
muted
13+
loop
14+
>
15+
<source src="./mobile-toc.mp4" type="video/mp4" />
16+
</video>
17+
</Frame>
18+
19+
Enable it by adding `mobile-toc: true` under `layout` in `docs.yml`:
20+
21+
```yaml docs.yml
22+
layout:
23+
mobile-toc: true
24+
```
25+
26+
<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/configuration/site-level-settings#layoutmobile-toc">Read the docs</Button>
1.56 MB
Binary file not shown.

fern/products/docs/pages/navigation/site-level-settings.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,12 @@ layout:
621621
If set to true, the feedback form won't be rendered. This can be overridden on a per-page basis using the [frontmatter](/learn/docs/configuration/page-level-settings#on-page-feedback).
622622
</ParamField>
623623

624+
<ParamField path="layout.mobile-toc" type="boolean" required={false} default="false" toc={true}>
625+
If set to true, a sticky table of contents bar is shown below the header on mobile and tablet viewports (under the `xl` breakpoint). The bar displays a scroll progress indicator and the current heading, and expands to the full table of contents when tapped.
626+
627+
Only applies to pages using the [`guide` and `overview` layouts](/learn/docs/configuration/page-level-settings#layout). The bar is hidden when a page has fewer than two headings or when `hide-toc: true` is set in the [page frontmatter](/learn/docs/configuration/page-level-settings#table-of-contents).
628+
</ParamField>
629+
624630
## Theme configuration
625631

626632
Customize the visual style of specific UI elements across your documentation site.

0 commit comments

Comments
 (0)