Skip to content

[Feature Request]: Add ability to control the initial state of expanded/collapsed navigation items #456

Closed

Description

@reakaleek

Prerequisites

  • I have searched existing issues to ensure this feature hasn't already been requested
  • I have tested using the latest version of docs-builder

What problem are you trying to solve?

Currently, we can only set the level of the expanded state of the navigation.

E.g. we can say expand all level 1 nav items

Proposed Solution

Add a new property called expanded into toc defintion, which is false by default.

E.g.

toc:
  - file: index.md
  - hidden: developer-notes.md
  - folder: contribute
    expanded: true # <-- this is the new attribute
    children:
      - file: index.md
      - file: locally.md
      - file: on-the-web.md
      - file: move.md
  - folder: migration

This way we have more control which navigation items should be collapsed or expanded when the user visits the documentation site for the first time.

Examples and Research

No response

Alternative Solutions

No response

Additional Context

No response

How important is this feature to you?

Nice to have

Activity

  1. locked and limited conversation to collaborators on Feb 10, 2025
  2. converted this issue into a discussionon Feb 10, 2025
  3. added 4 commits that reference this issue on Jan 27, 2026
    512c7e0
    4666782
    e971800
    d41f883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions