# Organize Starlight sidebars around reader tasks

Canonical: https://githtml.com/guides/starlight-sidebar-order-and-groups
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Use Starlight's sidebar configuration and page metadata to make important reader tasks easy to find, choosing explicit links or autogenerated groups deliberately. Verify the rendered order and destinations after building. A filesystem-derived menu is convenient, but directory names alone rarely explain the best learning or reference route for a newcomer.

## Choose the reading route before the configuration

List the tasks visitors bring to the documentation: start a sample, configure a feature, inspect an API, or troubleshoot a failure. Group pages around those needs rather than the names of internal teams or implementation folders. Decide which few pages deserve explicit placement and where automatic grouping is useful for a larger reference collection. Keep labels short but specific. A page called Advanced may be hard to discover because it does not reveal the subject. If several groups overlap, identify the primary home of each page before adding duplicate navigation entries that make the structure harder to reason about.

## Use a small group to verify the chosen mechanism

The sample shows illustrative internal slugs in an explicit sidebar group. Confirm syntax against the installed Starlight version and preserve existing configuration. If using autogenerated groups, inspect page metadata that controls ordering or labels and test what happens when a new file is added. Do not assume alphabetical order is an intentional tutorial sequence. Build locally and compare the menu with the task list written at the start. Check whether labels accurately describe the linked pages and whether collapsed groups hide the first action a newcomer needs. A sidebar should orient readers without requiring them to understand the repository layout.

````js
sidebar: [
  { label: 'Start', items: [{ slug: 'getting-started' }] },
  { label: 'Reference', items: [{ slug: 'reference/configuration' }] },
]
````

## Review navigation on both direct and sequential entry

Open a reference page directly, as a search visitor might, and see whether the sidebar explains where it belongs. Then follow the intended beginner route from the first page. Verify every configured destination and inspect any generated previous or next links used by the site. Recheck ordering when adding pages or renaming headings, particularly if labels are inferred from metadata. Keep menu edits in the same review as content moves so the reading route does not lag behind the source tree. The success criterion is that readers can predict where to go next, not merely that the sidebar configuration parses without errors. Keep intentionally unlisted pages documented in the editorial inventory. A sidebar is a reading route, not necessarily a complete list of generated pages or a boundary around private information.

1. Write the main reader tasks and assign each page a primary navigation home.
2. Choose explicit placement for key routes and automatic groups only where appropriate.
3. Build and inspect labels, order, groups, and direct destinations.
4. Test both a first-time reading route and direct entry into a nested reference page.

## Sources and further reading

- [Starlight sidebar navigation](https://starlight.astro.build/guides/sidebar/)

## Related guides

- [Check VitePress base paths before serving docs in a subdirectory](https://githtml.com/guides/vitepress-base-path-subdirectory-check)
- [Build and inspect a VitePress documentation artifact locally](https://githtml.com/guides/vitepress-local-production-artifact-review)
- [Verify VitePress local search without promising offline behavior](https://githtml.com/guides/vitepress-local-search-build-check)
- [How to open and share a Playwright HTML report](https://githtml.com/guides/open-share-playwright-html-report)

Editorial approach: https://githtml.com/guides/about
