Road header language switch

A thin fixed bar holding a wordmark, a small route code and one link to the other language, switched entirely by the document's lang attribute with no script.

MenusFreeFrom Dabab, UAE experienceTwo scriptsAbout 3k tokens saved
The whole page

Links in the preview stay on the block.

Open on its own

The prompt

One prompt, written to stand on its own: goal, structure, type, colour, spacing, behaviour and the words in square brackets to replace. Paste it into any tool that writes HTML. The Code tab has this block as one file.

806 words
Download .zip
# Road header language switch

One menus component, not a whole page: build it to drop into a page that already exists. Works in Claude, v0, Lovable, Bolt, Cursor or any tool that writes HTML.

## Goal
A fixed page header for a bilingual service page: a wordmark with a small route or version code beside it, and at the other end a single link to the other language. Both languages sit in the markup.

## Structure
1. Header fixed to the top of the viewport, above the page
2. Bar start: the wordmark as a link to the top, in both languages
3. A small mono code next to it, in the muted colour
4. Bar end: a nav labelled for the language choice
5. Two links inside it, one per language, the wrong one hidden

## Type
Outfit (Google 300 to 500) for Latin, Zain (Google 400, 700) for the second script, Atkinson Hyperlegible Mono (Google 400) for the code. Wordmark 500 20px/1, tracking -0.01em, and 700 26px when the page is in the second script. Code 12px, tabular figures. Language link 16px for the Latin word, 700 19px for the other script, 18px when the page itself is in that script. Page text 300 18px/1.5, and 400 20px/1.8 in the second script.

## Colour
Bar #E9EDF0 under a #C9D1D7 bottom rule. Wordmark and language link #0F1B24 (14.8:1), code #5E6B75 (4.7:1). Focus ring #076F76. AA: both text colours on the bar. Keep the bar opaque rather than translucent, since the page scrolls under it.

## Spacing and lines
Bar 56px tall, pinned to the top above the page, side padding clamp(20px,5vw,72px), wordmark and nav at opposite ends. The code sits 12px after the wordmark on the start side. The language link carries 8px of padding above and below. Give the document 72px of scroll padding so anchors clear the bar.

## Behaviour
No script needed. The switch runs off the document's lang attribute: one rule hides every element marked for the second script while the page is in the first language, and the reverse while it is in the second, so each page shows exactly one link, a plain href to the other language's folder with hreflang set. Hover and focus only raise the focus ring, which appears instantly. Nothing happens on load or on scroll: the bar does not shrink, hide, blur or recolour, so no scroll listener is needed.

## Responsive
Under 760px the mono code is hidden, leaving the wordmark alone at the start. The bar keeps its 56px height and clamped padding, and the link keeps its size, so nothing else changes.

## Accessibility
Use a header element and keep the links in a nav with an aria-label for the choice. Each link carries lang and hreflang for the language it points at, so a screen reader switches voice. The wordmark link holds an href to the top. The link target is 44px tall inside the 56px bar. Focus ring 2px #076F76 at 3px offset.

## Built values (from code.html)
- Fonts: Outfit 300, 400, 500 (Google Fonts); Atkinson Hyperlegible Mono 400 (Google Fonts); Zain 400, 700 (Google Fonts).
- Colour variables: --fog #E9EDF0, --ink #0F1B24, --muted #5E6B75, --line #C9D1D7, --teal #076F76.
- Font variables: --sans "Outfit", system-ui, sans-serif; --mono "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace; --arab "Zain", "Noto Naskh Arabic", system-ui, sans-serif.
- Size variables: --bar 56px, --ruler 76px, --gut clamp(20px, 5vw, 72px), --h1 clamp(44px, 8vw, 96px), --h2 clamp(36px, 5.6vw, 72px).
- Media queries: max-width 760px.
- No media files.
- Script: none, CSS only.

## Script
Carry two languages in one layout: every string has both versions in the markup and the root lang attribute decides which one shows, so switching is one attribute and no reload. Set the second script a step larger than the Latin so the two read at the same weight, and give it its own line height.

## Content to replace
- [Wordmark]: the product name, in both languages
- [Code]: a short route or version code, 2 to 4 characters
- [Language link]: the other language in its own script
- [Link targets]: where each language version lives, as a folder path

## Rules
Plain, specific copy that reads as a live product; never the word sample. No shadows, glow, glass, blur, gradient text, emoji or italics. Motion moves transform and opacity, with colour, border, height and stroke transitions on state changes, and holds its end state under prefers-reduced-motion. Text passes WCAG AA.

## Output
Return the block in one piece: the markup, one style block with the web fonts imported on its first line, and a small script only if the behaviour needs one. No page wrapper, no framework, no build step. Prefix every class with `blk-` and put the colours and sizes in CSS variables at the top.

More like this

Menus

Every menus block

Same page

More from Dabab

See the page