You can customize Astrobook via the astrobook() integration in astro.config.mjs.
directory
Specify the directory to scan for stories. Defaults to the current working directory.
astrobook({ directory: 'src/components' })
subpath
Specify the subpath where Astrobook is hosted. This is relative to your Astro project's base path.
astrobook({ subpath: '/playground' })
css
Provide an array of relative paths to CSS files to be imported into the Astrobook site.
astrobook({ css: ['./src/styles/custom.css'] })
head
Provide a path to an Astro component containing custom <head> elements (e.g., <link>, <style>, <script>).
astrobook({ head: './src/components/CustomHead.astro' })
home
Provide a path to an Astro component to replace the default dashboard homepage.
astrobook({ home: './src/components/CustomHome.astro' })
title
Set the website title.
astrobook({ title: 'My Components Playground' })
import { defineConfig } from 'astro/config'
import astrobook from 'astrobook'
export default defineConfig({
integrations: [
astrobook({
directory: 'src/components',
subpath: '/playground',
css: ['./src/styles/custom.css'],
head: './src/components/CustomHead.astro',
home: './src/components/CustomHome.astro',
title: 'My Components Playground',
}),
],
})