qwik-docs ships sensible default styling and features. It runs with no configuration. When you want to customize the look and feel, this guide covers the options.
Customization lives in two places.
Site-wide options go in qwik-docs.config.ts through defineConfig, the equivalent of Astro Starlight's starlight({...}) integration options.
Per-page overrides go in Markdown frontmatter, validated by the frontmatter schema.
Add your logo
Add a logo to the site header through the logo option in qwik-docs.config.ts.
-
Put your logo file in the
public/directory. It is served from the site root.- public/
- my-logo.svg
- content/
- qwik-docs.config.ts
- public/
-
Set the public URL of your logo as
logo.src:// qwik-docs.config.ts import { defineConfig } from '@qwik-docs/framework'; export default defineConfig({ title: 'Docs With My Logo', logo: { src: '/my-logo.svg', }, });
By default, the logo shows alongside the site title.
When the logo already includes the site name, hide the title text by setting replacesTitle.
The title text stays in the DOM, visually hidden, so the header stays accessible and searchable.
defineConfig({
title: 'Docs With My Logo',
logo: {
src: '/my-logo.svg',
replacesTitle: true,
},
});
Light and dark logo variants
Show a different logo in light and dark mode.
Provide light and dark instead of src. The two are mutually exclusive with src.
-
Add a file for each variant to
public/:- public/
- light-logo.svg
- dark-logo.svg
- content/
- qwik-docs.config.ts
- public/
-
Set the URLs as the
lightanddarkoptions:defineConfig({ title: 'Docs With My Logo', logo: { light: '/light-logo.svg', dark: '/dark-logo.svg', }, });
Site title and public URL
title is required. It sets the header title and the default page <title>.
site is the public origin of the deployed site, for example https://docs.example.com.
It builds absolute links, such as the "Chat in Claude.ai" action.
When omitted, that action is hidden.
defineConfig({
title: 'My Docs',
site: 'https://docs.example.com',
});
Sitemap
When site is set, the Vite plugin writes a sitemap.xml at build under the deploy base.
This mirrors the sitemap Astro Starlight's site drives through Astro's sitemap integration.
Opt out with sitemap: false:
defineConfig({
title: 'My Docs',
site: 'https://docs.example.com',
sitemap: false,
});
Social links
Add links to your social accounts in the site header through the social option.
Each entry is an object with three properties:
icon: an icon name, for example"github".label: an accessible label for the link, for example"GitHub".href: the URL for the link.
defineConfig({
title: 'Docs With Social Links',
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' },
],
});
Edit links
qwik-docs shows an "Edit page" link in each page's footer.
Set editLink.baseUrl to the URL used to edit your repository.
The base URL is prepended to the page's source path to form the full edit link.
Common patterns:
- GitHub:
https://github.com/USER_NAME/REPO_NAME/edit/BRANCH_NAME/ - GitLab:
https://gitlab.com/USER_NAME/REPO_NAME/-/edit/BRANCH_NAME/
If your content is not at the repository root, include the path to it at the end of the base URL.
defineConfig({
title: 'Docs With Edit Links',
editLink: {
baseUrl: 'https://github.com/withastro/starlight/edit/main/docs/',
},
});
Override the edit link per page with the editUrl frontmatter field.
A string sets the link directly. false removes it from that page.
---
# content/example.md
title: Page with a custom edit link
editUrl: false
---
Copy page
The "Copy page" split button appears beside the page title.
It copies the raw Markdown and, when site is set, offers a "Chat in Claude.ai" action seeded with the page.
Enable it site-wide with features.copyPage:
defineConfig({
title: 'My Docs',
features: {
copyPage: true,
},
});
Opt a single page out with the features frontmatter field:
---
# content/example.md
title: Page without the copy button
features:
copy-page: false
---
Page layout
By default, pages use a layout with a navigation sidebar and a table of contents.
Apply a wider layout without sidebars by setting template: splash in a page's frontmatter.
This suits landing pages.
---
# content/index.md
title: My Landing Page
template: splash
---
Table of contents
qwik-docs shows a table of contents on each page.
By default it includes <h2> and <h3> headings.
Change the levels site-wide with the tableOfContents option in qwik-docs.config.ts.
Set minHeadingLevel, maxHeadingLevel, or both.
defineConfig({
title: 'My Docs',
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 4,
},
});
Override the levels per page with the tableOfContents frontmatter field. This takes precedence over the site-wide default.
---
# content/example.md
title: Page with only H2s in the table of contents
tableOfContents:
minHeadingLevel: 2
maxHeadingLevel: 2
---
Disable it for a page by setting tableOfContents: false:
---
# content/example.md
title: Page without a table of contents
tableOfContents: false
---
Last updated
qwik-docs shows a "Last updated" date in the page footer.
Enable it site-wide with the lastUpdated option in qwik-docs.config.ts.
When true, the Vite plugin reads each file's last commit date from Git at build and renders it in the footer, matching Astro Starlight's Git-derived dates.
defineConfig({
title: 'My Docs',
lastUpdated: true,
});
Override the date for a single page with the lastUpdated frontmatter field. A date takes precedence over the Git commit date.
---
# content/example.md
title: Page with a last-updated date
lastUpdated: 2024-08-09
---
Setting lastUpdated: false in frontmatter hides the date for that page.
Pagination
qwik-docs renders previous and next links in the page footer. They are derived from sidebar order.
Override them per page with the prev and next frontmatter fields.
false removes a link. A string relabels it. An object sets link and label.
---
# content/example.md
title: Page with custom pagination
prev: false
next:
link: /docs/guides/pages/
label: Continue to Pages
---
There is no pagination key in qwik-docs.config.ts. Pagination is always on and controlled through the sidebar and these frontmatter fields.
Custom <head> tags
Add tags to a page's <head> with the head frontmatter field.
Each entry has a tag, optional attrs, and optional content.
qwik-docs renders the full Astro Starlight tag set — title, base, link, style, meta, script, noscript, and template — into Qwik City's document head.
---
# content/example.md
title: Page with custom head tags
head:
- tag: meta
attrs:
property: og:image
content: https://docs.example.com/og.png
---
Site-wide head tags
Add tags to every page's <head> with the head option in qwik-docs.config.ts.
The site-wide tags are merged before per-page frontmatter head, so a page can override them.
defineConfig({
title: 'My Docs',
head: [
{
tag: 'script',
attrs: { src: 'https://example.com/analytics.js', defer: true },
},
],
});
Favicon
Set the site favicon with the favicon option in qwik-docs.config.ts.
The value is a path to a file in the public/ directory.
The framework emits the <link rel="icon"> for you, with the correct MIME type inferred from the file extension. The path is resolved against the deploy base, so it stays correct when the site is served from a subfolder.
-
Put your favicon in the
public/directory.- public/
- favicon.svg
- content/
- qwik-docs.config.ts
- public/
-
Set the path as the
faviconoption:defineConfig({ title: 'My Docs', favicon: '/favicon.svg', });
To add other icon variants, for example a .ico fallback or an Apple touch icon, add link tags with the site-wide head option.
Custom fonts
By default, qwik-docs uses a system sans-serif font stack. This loads fast in a familiar font with no font download.
To use a custom font, declare it in a CSS file and apply it through a custom CSS property.
Add the CSS file with the customCss config option, the same way you add any custom styles.
See the CSS and styling guide for how to add custom CSS.
Set up local font files
-
Add your font files and an
@font-facestylesheet undersrc/:- src/
- fonts/
- CustomFont.woff2
- font-face.css
- fonts/
- content/
- qwik-docs.config.ts
- src/
-
Add an
@font-facedeclaration for each font. Use a relative path to the font file inurl()./* src/fonts/font-face.css */ @font-face { font-family: 'Custom Font'; src: url('./CustomFont.woff2') format('woff2'); font-weight: normal; font-style: normal; font-display: swap; } -
Import the stylesheet in your global CSS. See the CSS and styling guide.
Use fonts
Apply the font by setting the --sl-font custom property in a custom CSS file:
:root {
--sl-font: 'Custom Font', sans-serif;
}
Target the main content only, leaving the sidebars on the default font:
main {
font-family: 'Custom Font', sans-serif;
}
Follow the custom CSS instructions to add these styles.
Component overrides
Swap built-in UI components — the header, the footer, the sidebar, and more — with the components map in qwik-docs.config.ts.
Each entry maps a built-in component name to a path to your own Qwik .tsx.
defineConfig({
title: 'My Docs',
components: {
Header: './src/overrides/MyHeader.tsx',
},
});
A replacement can re-render the built-in by importing it aliased as Default, so partial overrides compose.
See Overriding Components for the overridable component names, the props each receives, and the Default pattern.