Theme configuration

directory()#

Directories hold a site's sidebar navigation items.

Example#

theme.config.tsx
export default defineTheme({
  directories: [
    directory("dir-a", {
      sidebar: [
        link("Home", "/home"),
      ]
    })
  ],
})

Reference#

function directory(id, options);

idstringrequired

The ID of the directory - Can be anything and is only used for referencing in meta files or similar.

optionsDirectoryOptionsrequired

All options of the directory.


layoutstring

The default layout to show for all pages associated with this directory. Defaults to the layout for the site.

settingsLayoutSettings

The layout settings for this directory, read more about layout settings.

The settings in this settings layer are applied last - overriding settings defined in sites and layouts.

sidebarArray<LinkComponent | NestableLinkComponent | SeparatorComponent | CustomComponentComponent | GroupComponent<GroupComponentChildren>>

List of links to show in the sidebar. You can specify link(), link.nested(), separator(), component(), group() (groups can hold all other types except for more groups).

Read more about those on their respective documentation pages.