Theme configuration

link()#

A standard link for your navigation items. You can also nest links.

Example#

theme.config.tsx
export default defineTheme({
  directories: [
    directory("dir-a", {
      sidebar: [
        link("Home", "/home"),
        link.nested("Guides", [
          link("Guide A", "/guides/a"),
          link("Guide B", "/guides/b"),
        ]),
      ]
    })
  ],
})
function link(title, to, options);

titlestringrequired

The title of the link.

tostringrequired

Where the link goes to. For example: /docs/guides/guide-a.

optionsExtraLinkOptions

Extra options for this link. All fields are optional.

function link(options);

optionsExtraLinkOptions

The options for this link.

function link.nested(title, to, items);

titlestringrequired

The title of the link.

tostringrequired

Where the link goes to. For example: /docs/guides/guide-a.

itemsArray<LinkComponent | SeparatorComponent>required

The child items of the nested link.

function link.nested(title, items);

titlestringrequired

The title of the link.

itemsArray<LinkComponent | SeparatorComponent>required

The child items of the nested link.

function link.nested(options);

optionsNestedLinkOptions

The options for this nested link.