Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fern/products/docs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ navigation:
path: ./pages/customization/what-is-docs-yml.mdx
- page: Navigation
path: ./pages/navigation/overview.mdx
- page: Tabs and tab variants
path: ./pages/navigation/tabs.mdx
slug: tabs
- page: Versions
path: ./pages/navigation/versions.mdx
- page: Products
Expand Down
28 changes: 28 additions & 0 deletions fern/products/docs/pages/changelog/2025-11-03.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## Tab variants

Create multiple content variations within a single tab using the new variants feature. This allows you to show different perspectives, user types, or implementation approaches for the same topic without creating separate tabs.

You can now define variants for tabs with different layouts, titles, subtitles, and icons. Each variant can have its own navigation structure, and you can explicitly set which variant should be the default.
Copy link
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.Current] Avoid time-relative terms like 'now' that become outdated


```yaml title="docs.yml"
navigation:
- tab: guides
variants:
- title: For developers
layout:
- section: Getting started
contents:
- page: Quick start
path: ./pages/dev-quickstart.mdx
- title: For product managers
default: true
layout:
- section: Getting started
contents:
- page: Overview
path: ./pages/pm-overview.mdx
```

[Learn more about tab variants](/learn/docs/configuration/tabs).

## Custom icons across your navigation

You can now use your own image files as icons throughout your `docs.yml` navigation config, including for [navbar link](/learn/docs/configuration/what-is-docs-yml#navbar-links-configuration), [section, page](/learn/docs/configuration/navigation#sidebar-icons), and [product](/learn/docs/configuration/products#add-your-product-configuration) icons.
Expand Down Expand Up @@ -44,3 +71,4 @@ products:
```

Visit the [product switching documentation](/learn/docs/configuration/products#define-your-products) to learn more.

54 changes: 1 addition & 53 deletions fern/products/docs/pages/navigation/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -242,59 +242,7 @@ navigation:

## Tabs

Within the navigation, you can add `tabs`. Tabs are used to group sections together. The example below shows tabs for `Help Center`, `API Reference`, and an external link to `Github`. Each tab has a `title` and `icon`.

<Markdown src="/snippets/icons.mdx" />

<CodeBlock title="docs.yml">
{/* <!-- vale off --> */}

```yaml
tabs:
api:
display-name: API Reference
icon: puzzle # Font Awesome icon
help:
display-name: Help center
icon: ./assets/icons/help-icon.svg # Custom image file
github:
display-name: GitHub
icon: brands github # Font Awesome icon
href: https://github.com/fern-api/fern

navigation:
- tab: api
layout:
- section: Introduction
contents:
- page: My page
path: my-page.mdx
- api: API Reference
- tab: help
layout:
- section: Help center
contents:
- page: Contact us
path: contact-us.mdx
- tab: github
```
{/* <!-- vale on --> */}
</CodeBlock>

Here's an example of what the Tabs implementation looks like:

<Frame>
<img src="./images/tabs-sidebar.png" alt="Tabs displayed in the sidebar (default)" />
</Frame>

Tabs display in the left sidebar by default. To display them horizontally, set `tabs-placement` to `header` in your [layout configuration](/docs/configuration/what-is-docs-yml#layout-configuration).

<CodeBlock title="docs.yml">
```yaml
layout:
tabs-placement: header
```
</CodeBlock>
You can add tabs to group sections of content together. Tabs can contain different layouts and navigation structures, and you can use tab variants to show different content variations within a single tab. For more information, see [Tabs and tab variants](/learn/docs/configuration/tabs).

## Versions

Expand Down
160 changes: 160 additions & 0 deletions fern/products/docs/pages/navigation/tabs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
title: Tabs and tab variants
description: Organize your documentation with tabs and show different content variations using tab variants.
---

Tabs let you group sections of your documentation together, while tab variants allow you to display different content perspectives within a single tab.

## Tabs

Add `tabs` to group sections together. The example below shows tabs for `Help Center`, `API Reference`, and an external link to `Github`. Each tab has a `title` and `icon`.

<CodeBlock>
{/* <!-- vale off --> */}

```yaml title="docs.yml"
tabs:
api:
display-name: API Reference
icon: puzzle # Font Awesome icon
help:
display-name: Help center
icon: ./assets/icons/help-icon.svg # Custom image file
github:
display-name: GitHub
icon: brands github # Font Awesome icon
href: https://github.com/fern-api/fern

navigation:
- tab: api
layout:
- section: Introduction
contents:
- page: My page
path: my-page.mdx
- api: API Reference
- tab: help
layout:
- section: Help center
contents:
- page: Contact us
path: contact-us.mdx
- tab: github
```
{/* <!-- vale on --> */}
</CodeBlock>
<Note title="Tab icons">
<Markdown src="/snippets/icons.mdx" />
</Note>
Here's an example of how a tabs implementation renders:
<Frame>
<img src="./images/tabs-sidebar.png" alt="Tabs displayed in the sidebar (default)" />
</Frame>
### Tabs placement
Tabs display in the left sidebar by default. To display them horizontally, set `tabs-placement` to `header` in your [layout configuration](/docs/configuration/what-is-docs-yml#layout-configuration).

<CodeBlock title="docs.yml">
```yaml
layout:
tabs-placement: header
```
</CodeBlock>


## Tab variants

Tab variants let you display different content variations within a single tab, and [support RBAC](/learn/docs/authentication/rbac). This is useful for showing different user types, implementation approaches, or experience levels without creating separate tabs.

<Tip title="When to use variants vs. tabs">
Use **variants** for different perspectives on the same content area (REST vs. GraphQL, beginner vs. advanced). Use **tabs** for completely different documentation sections (guides vs. API Reference).
Copy link
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] 'REST' has no definition.

</Tip>

### Basic usage

Define a tab with a `variants` property instead of a `layout` property. Each variant has its own title and layout. The example below shows two variants for the `Help Center` tab.

```yaml title="docs.yml" startLine=20 {22-34}
tabs:
api:
display-name: API Reference
icon: puzzle
help:
display-name: Help center
icon: home
github:
display-name: GitHub
icon: brands github
href: https://github.com/fern-api/fern
navigation:
- tab: api
layout:
- section: Introduction
contents:
- page: My page
path: my-page.mdx
- api: API Reference
- tab: help
variants:
- title: For developers
layout:
- section: Getting started
contents:
- page: Quick start
path: ./pages/dev-quickstart.mdx
- title: For product managers
layout:
- section: Getting started
contents:
- page: Overview
path: ./pages/pm-overview.mdx
- tab: github
```

### Variant properties

<ParamField path="title" type="string" required={true}>
Display name for the variant
</ParamField>

<ParamField path="layout" type="list" required={true}>
Navigation structure using the same format as regular tab layouts
</ParamField>

<ParamField path="subtitle" type="string">
Text displayed below the variant title
</ParamField>

<ParamField path="icon" type="string">
<Markdown src="/snippets/icons.mdx" />
</ParamField>

<ParamField path="slug" type="string">
Custom URL slug for the variant
</ParamField>

<ParamField path="skip-slug" type="boolean">
Exclude the variant slug from URLs
</ParamField>

<ParamField path="hidden" type="boolean">
Hide the variant from navigation
</ParamField>

<ParamField path="default" type="boolean">
When true, this variant displays by default. If not specified, the first variant in the list is used.
</ParamField>

<ParamField path="viewers" type="string | list">
Role-based access control for the variant
</ParamField>

<ParamField path="feature-flag" type="string | object">
Conditional display configuration
</ParamField>

2 changes: 1 addition & 1 deletion fern/snippets/icons.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Icons support three formats:
Icons can be in three formats:
- **Font Awesome icons**: Use icon names like `fa-solid fa-rocket`. Pro and Brand Icons from Font Awesome are supported.
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
Loading