Skip to content
Astro Lumetric
Start free

Docs · Make it yours

The header and the bar

The header, its Sign in link, the menu on a phone, and the announcement bar above them.

All docs pages
On this page
  1. The header
  2. The announcement bar
  3. How they move together

The header

The header runs across the top of the page: the logo, the menu (Features, Pricing, Docs, Customers and Blog), then the light/dark button, the search icon, your GitHub icon, the “Sign in” link and the “Start free” button, which leads to your sign-up page (signUp, see Settings) or, without one, to the pricing page. The search icon opens the search page (/search/), and Sign in the sign-in page (/login/, with signIn.show on; see Settings).

At the top of the page the header has no background of its own, only a fine line under it. As soon as the page scrolls, it takes the page’s background, a little see-through, with the page blurred behind it. In the grid design the line runs only across the ruled column. The script in src/components/site/SiteHeader.astro only changes its classes; the browser moves it.

From 1024px wide the header shows the menu; narrower screens get a menu button. Below 640px, on an upright phone, the search icon, the Sign in link and the Start free button are hidden to give the header room, and a phone on its side (lower than 500px) leaves out the button too; the phone menu has all three.

The phone menu opens as a panel (src/components/site/MobileMenu.astro): a search field, Home, the menu’s items, About and Contact, each with an icon, the current page’s icon on lime, then the Sign in and Start free buttons. Name, links and menu says where the menu and the header’s links are set.

The announcement bar

The bar sits above the header: a near-black strip in light and dark mode, with one or two announcements side by side, divided by a thin line. Each is a link with an optional label, such as “New”, on lime, a title in bold, a short line and an arrow. Visitors can close it, unless closable is false.

It’s set in announcement in src/config/theme.config.mjs:

announcement: {
  show: true,
  mobile: true,
  closable: false,
  id: 'lumetric-demo',
  items: [
    { href: 'https://github.com/hansmartensdev/Astro-Lumetric', key: 'announcement.first' },
    { href: '/docs/', key: 'announcement.docs', icon: 'book-open' },
  ],
},
Field What it does
show false removes the bar. The demo’s bar announces the theme and links to these docs: turn it off or change it on your own site.
mobile false hides it on a phone, below 640px.
closable false leaves out the close button: the bar always shows, and nothing is kept in the browser. Leave it out, or true, for the button; a closed bar is then remembered in the browser, and the privacy page says so.
id A closed bar stays closed for this id. Give a new announcement a new id, so visitors who closed the last one see it.
items One or two announcements: the link (a path on this site or a full address), and the key of its words in the translations (tag, title and text, under announcement). icon, a Lucide name, replaces the label.

Check that no announcement links to a page that’s turned off, such as /docs/ with docs: false.

Below 900px wide only the first announcement shows, with its label and title, centred.

How they move together

The bar and the header are one sticky block. The bar scrolls away with the page, and the block sticks once the header reaches the top. A small script measures the bar’s height (--announce-h); the browser does the moving, so the two never come apart.