Skip to content
New: Customize your theme with an AI assistant. Read the guide

Customizing The Header

Files: src/config/config.toml, src/layouts/components/global/header/ · Skill level: Beginner

Veltro has one shared header at src/layouts/components/global/header/Header.astro. src/layouts/Base.astro renders it on every page. To change the links, see Menus. For how the menu behaves, see Navigation.

In the Tina edition, the options below are under Site settings > Settings at /admin/. In the Sanity edition, they are under Site settings > Settings in the Studio. The labels are in Interface labels in both.

Header Position And Behavior

Base.astro accepts these, and a page file in src/pages/[...lang]/ sets them in code:

headerPosition?: "fixed" | "static" | "sticky";
headerBorderOnScroll?: boolean;
hideOffcanvas?: boolean;
hideHeader?: boolean;

headerPosition defaults to sticky. The second homepage turns on headerBorderOnScroll. hideHeader leaves the header out, for a page that brings its own top bar.

[settings]
stickyHeader = true

stickyHeader only matters on a page with headerPosition="static". Fixed and sticky headers always have the scroll behavior.

[settings.navigationButton]
enable = true
label = ""
url = "/contact/"

When label is empty, Veltro uses navigation.buttonLabel from src/i18n/<lang>.json, so each language has its own.

The Two Panels

The header opens two different panels.

The contact side panel. The round action button opens SideMenu.astro, on every screen size. Its text comes from headerOffcanvas.description and the sideMenu keys in src/i18n/<lang>.json. Its contact details come from [settings.contactInfo] in config.toml, and its social links from src/config/social.json.

The mobile menu. The menu button opens the mobile menu, with the logo, the menu, and the navigation action:

[settings.headerOffcanvas]
enable = true
logo = ""

enable turns the panel on and off, and logo replaces the logo in it. hideOffcanvas defaults to true, which keeps this panel on small screens unless a page passes hideOffcanvas={false}.

config.toml also has description and a [settings.headerOffcanvas.button] block. Nothing reads them on this theme, so changing them has no effect.

Language Switcher

The header shows LanguageSwitcher.astro when multilingual support is on. The list of languages comes from src/config/language.json. See Internationalization.

Files

FileWhat it does
header/Header.astroThe header bar and its options
header/Navbar.astro, header/MenuItem.astroThe menu
header/NavStage.astro, NavStageDropdown.astro, NavStageList.astro, NavStageMega.astroThe desktop dropdown panel
header/DropdownMenu.astro, header/MegaMenu.astro, header/NavbarToggler.astroThe mobile menu
header/SideMenu.astroThe contact side panel
header/LanguageSwitcher.astroThe language switcher

All of these are under src/layouts/components/global/. The mobile panel itself is src/layouts/components/widgets/HeaderOffcanvasContent.astro.

Type something to search...