Skip to content

Default theme

The layout this site uses: a navbar with sections and dropdowns, a sidebar built from your pages, a table of contents, previous and next links, dark mode, and web components for tabs, callouts and code frames.

Add it

Terminal
dotnet add package Nacara.Theme.Default --prerelease
open Nacara.Theme

let theme = Theme.defaults

let site =
    Site.create "My library"
    |> Site.baseUrl "/"
    |> Markdown.register
    |> Theme.register theme
    |> Site.collection (Theme.docs theme "content")

Theme.register ships the stylesheet and the components. Theme.docs is a ready-made collection using the theme's own front matter and layout; point it at the directory holding your markdown.

Configuring it

Every option is a setter, and they pipe:

let theme =
    Theme.defaults
    |> Theme.navbar [ NavbarSection("Guide", "guide", "/guide/getting-started/") ]
    |> Theme.navbarEnd [ NavbarDynamicWidget Search.trigger ]
    |> Theme.menu "guide" [ Menu.page "guide/getting-started.md" ]
    |> Theme.editUrl "https://github.com/you/project/edit/main"
    |> Theme.footer (Html.p [ Html.text "© 2026 You" ])
navbar, navbarEndWhat sits across the top
menu, menusThe sidebar of a section
editUrlAdds "Edit this page"
footer, headExtra, favIconThe rest of the frame
cssA rule or two, without a stylesheet

The pages of this section

  • Navbar - sections, dropdowns, icons, and the frame around the page
  • Menu - where a sidebar comes from, and how to write your own
  • Front matter - what a page says about itself
  • Customising - colours, spacing, fonts, your own CSS
  • Components - the pieces on their own, and building a layout

Using another theme

Register your own theme instead. Theming explains what a theme has to provide.

Reference

Every function and option, signature by signature: Theme.

Edit this page