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

Files: src/config/config.toml, src/config/menu.<lang>.json, src/i18n/<lang>.json, src/pages/[...lang]/*.astro · Skill level: Beginner (light code to change a page’s layout)

Every header has the logo, the menu with its Practice areas mega menu and the Home and Firm dropdowns, a language menu, and a Free consultation button. Covena has three header layouts, and each homepage uses a different one. Below 1024 px the menu folds into a menu button that opens a side panel.

The Three Layouts

panel: a white panel with a row of three contact chips (“Call us”, “Email us”, “Visit us”) above the menu. Home 1 (/) floats it over the navy hero, and every inner page uses it with a thin outline.

Covena panel header with the contact chips above the menu

bar: a full-width white bar under a navy strip with links to the office cities and the phone number. Used on Home 2 (/home-corporate/).

Covena bar header with the office strip above it

transparent: white text over the hero photo, which turns into a solid white bar once the page scrolls. It also turns solid when a page loads already scrolled, after a reload or a link to a #section. It has the Quick exit button. Used on Home 3 (/home-family/).

Covena transparent header over the Home 3 hero photo, with the Quick exit button

Choose The Layout Of A Page

Each page picks its header in its route file in src/pages/[...lang]/, with props on Base:

src/pages/[...lang]/home-corporate.astro
<Base {...data} headerVariant="bar" footerVariant="columns-light">
PropValuesWhat it does
headerVariantpanel (default), bar, transparentThe header layout
headerOverlaytrue or false (default)panel only: the header floats over the first section, as on Home 1

A page that doesn’t set headerVariant gets panel. Use transparent only on a page that opens with a full photo or a dark hero, because its text is white until the page scrolls.

Header Settings

src/config/config.toml
[settings]
stickyHeader = true
[settings.header]
showChips = true
showOfficeStrip = true
showLanguageSwitcher = true
[settings.navigationButton]
enable = true
label = "" # Empty uses navigation.buttonLabel ("Free consultation")
url = "/consultation/"
SettingWhat it does
stickyHeadertrue brings the menu bar back when visitors scroll up, and hides it while they scroll down. The chip row and the office strip always scroll away with the page
showChipsThe “Call us / Email us / Visit us” row in the panel header
showOfficeStripThe strip above the bar header
showLanguageSwitcherThe language menu in the header. It shows from 1320 px wide, where the header has room. Below 1024 px it is in the mobile menu, and the footer has a language menu at every width
navigationButtonThe button at the end of the menu. label empty uses navigation.buttonLabel in src/i18n/<lang>.json

Where the chips and strip get their text. The phone and email come from [settings.contactInfo], and the address in the “Visit us” chip from contactInfo.address in src/i18n/<lang>.json. The city links in the strip come from the office files in src/content/offices/<language>/, so a new office appears there by itself. The labels (“Call us”, “Email us”, “Visit us”) are under header in each language file. See Firm Info.

Quick Exit

The transparent header on Home 3 has a Quick exit button for visitors reading about family or domestic matters. It sends them to a neutral page at once, and pressing Escape twice does the same. [settings.quickExit] turns it off, changes where it goes, or adds it to every header:

[settings.quickExit]
enable = true
everyPage = false
url = "https://www.bbc.co.uk/weather"
label = ""

With everyPage = true the button is also in the panel and bar headers and in the mobile menu. The header row then makes room for it: the language menu shows its short code (EN) below 1440 px, and the consultation button shows from 1320 px wide (from 1440 px in the panel header). The menu still has Contact, and the mobile menu keeps the consultation button. The full guide is Quick Exit.

The Menu

The links in the header come from headerPrimary in src/config/menu.<lang>.json, one file per language. Covena ships seven items: Home (a dropdown of the three homepages), Practice areas (a mega menu with three groups and a bottom row), Attorneys, Results, Firm (a dropdown), Insights, and Contact. Menus explains how to edit them, and Navigation how the menu behaves.

The Mobile Menu

Below 1024 px the menu button opens a side panel with the logo, the menu with submenus that open in place, the consultation button, the phone and email, and the language menu. It uses the same menu file as the desktop header, so there is nothing extra to edit.

Files For Developers

FileWhat it does
src/layouts/components/global/header/Header.astroThe three layouts, chips, strip, and buttons
src/layouts/components/global/header/QuickExit.astroThe quick exit button and the Escape keys
src/layouts/components/global/header/LanguageSwitcher.astroThe language menu
src/layouts/components/widgets/HeaderOffcanvasContent.astroThe mobile menu panel
src/plugins/smartHeader.tsHides and shows the bar on scroll
src/styles/header.css, src/styles/smart-header.cssHeader styles

Do It With AI

In src/pages/[...lang]/about/index.astro, give the About page the "bar" header: add
headerVariant="bar" to the <Base> component and change nothing else. In src/config/config.toml set
[settings.navigationButton] url to "/contact/" and label to "", and set navigation.buttonLabel in
every file in src/i18n/ to "[LABEL]", translated. Then run npm run astro-check.
Type something to search...