Marketing Header
The wordmark, the main links and the actions in one sticky bar that folds into a floating pill once the page starts to scroll.
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add marketing-headerAlso works with shadcn:
npx shadcn@latest add @ritla/marketing-headerDependencies it brings
@phosphor-icons/reactOr copy by hand
Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.
Usage
import { MarketingHeader } from "@/components/ui/marketing-header";<MarketingHeader logo={<Wordmark />} links={[ { label: "Components", href: "/ui" }, { label: "Docs", href: "/docs" }, { label: "Pricing", href: "/#pricing" }, ]} menuLinks={[{ label: "Sign in", href: "/login" }]} actions={<Button size="sm" render={<a href="/#top" />}>Scan your site free</Button>}/>Examples
The folded pill
With folded the header holds the pill: a frosted card with a hairline border and a shadow. It is as tall as the open bar, so the page never moves under the reader's thumb while it folds.
Links in the centre
With navPosition="center" the links sit on the bar's centre line between the wordmark and the actions, whatever their widths, as Figma's Nav position Center draws them. On narrow screens the links stay in the menu.
API reference
MarketingHeader
| Prop | Type | Default | Description |
|---|---|---|---|
logo | ReactNode | None | The wordmark, linked home. |
links | { label, href, current?, lang?, hrefLang? }[] | None | The main links, in reading order. current sets aria-current="page"; lang marks text in another language, such as Figma; hrefLang="en" marks a link to an English-only page. |
actions | ReactNode | None | The bar's end: language, sign in and one call to action. They stay in the bar on a phone. |
menuLinks | { label, href }[] | None | Extra links in the phone menu only, after links. |
folded | boolean | None | Without it the header folds with the scroll; true or false holds one state. |
navPosition | "start" | "center" | "start" | Where the links sit on wide screens: after the wordmark, or on the bar's centre line. |
copy | { nav, menu, close } | None | The nav's name and the menu button's two names; the default follows the page language. |
Accessibility
Keyboard
Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.
| Key | Action |
|---|---|
| Tab | The wordmark, the links, then the actions; the menu button on narrow screens. |
| Enter | The menu button opens or closes the links under the bar. |
| Escape | Closes the open menu and returns focus to the menu button. |
ARIA
- The header is the page's banner (
header) and the links a named navigation (“Primary”). - The current page's link carries
aria-current="page". - The menu button states
aria-expandedand names what it will do (“Menu” or “Close menu”).
Arabic and RTL notes
Mirrors
- The wordmark at the line's start on the right, the actions at its end on the left.
- The carets in the phone menu point left.
Does not mirror
- The wordmark itself is Latin and never mirrors.
- Numerals
- The header writes no numbers.
- Arabic typography
- Links
body-14Medium,body-16in the phone menu.