Header
In a Récit site (A site), header.
renders a 44px format menu bar beneath the main header bar. Passing the same items list on every
site of a family keeps the row and its width identical from one site to another while marking the
current format in place.
recit.config.ts
| Key | Type / values | Effect |
|---|---|---|
header. | HeaderFormatsConfig | Enables the format menu bar beneath the main header bar. |
formats. | string | Accessible name (aria-label) of the <nav> landmark, and of the scrollable region when the row overflows. Defaults to "Formats" (formatsNavigation in the site's UI strings). |
formats. | HeaderFormatItem[] | Ordered list of formats displayed across the row. |
items[]. | string | Visible name of the format (14px, weight 500, var(--). |
items[].href | string | Target URL when status is "available". |
items[].hue | BrandHue | Brand palette hue of the swatch (--recit-): "violet", "indigo", "blue", "teal", "green", "amber", "orange", "red", "magenta", "sky", "lime", "graphite". |
items[]. | "available" | "planned" | "available" renders a link when href is set; "planned" renders plain text without a link. |
items[]. | boolean | Marks the current site's format (aria-, full ink var(--, weight 700). |
formats.all | { label, href } | Optional trailing link (string label and href) pushed to the far end of the row. |
What the menu displays
- Slanted hue swatch: every item begins with a decorative
8 × 16pxswatch (aria-hidden,3pxradius) slanted atskewX(-(15deg) skewX(15deg)in right-to-left layouts) and colored withvar(--.recit- hue- <hue>) - Current format: an item with
current:carriestrue aria-, switches to full ink (current= "page" var(--) and weightrecit- text) 700, and reserves its bold width with an invisible pseudo-element so adjacent items never shift. It stays marked, in full, when it is planned or has no site online yet: the reader is on its site. - Format without a site yet: an
availableitem with nohrefrenders as plain text, dims its swatch to40%, and appends a visually hidden(no site yet)((pas encore de site)in French). - Planned format: an item with
status:renders as plain text with no link, dims its swatch to"planned" 40%opacity, and appends a visually hidden(planned)label ((prévu)in French) for screen readers. - Row and mobile: the bar sits on
var(--(recit- surface- 2) 44pxtall,16pxgap, horizontal padding aligned with the header's, no border or divider), pushesformats.allto the end of the row when set, scrolls horizontally when wider than the viewport (gainingtabIndex={0}and an accessible region name), and is hidden below48em. On a phone, the available formats with anhrefandformats.allalso open the list of the navigation drawer, beforeheader..navigation - Phone picker: below
48em, a48pxbar under the header (--format-) shows "Formats" followed by the current format with its swatch, and opens a menu of every format: links for the available ones, planned ones and formats without a site disabled (the current one stays marked withpicker- height aria-),current= "page" formats.alllast. The header height counts it. The phone's menu button draws two strokes.
Tabs in the bar
header. places the tabs of the top navigation: on their own row under the bar
("row", the default), or in the bar, before the header links ("bar"), as the « Marques » mockups
draw it. Keep "row" for a site with many tabs: the bar has room for four or five.
recit.config.ts
With placements., the search pill comes after the links, 220 px wide; below 80em it
is the magnifier alone, still named « Search ». The header links are 16 px, weight 500.
A centred brand
header. places the logo or the site's title: at the start of the bar ("start",
the default), or at its centre on a wide screen ("center"), as a shop often draws it. The centre
is then the brand's alone: the search, and a navigation placed at the centre, go to the end. A phone
keeps the brand at the start. The layout stays a setting of the site: a theme direction never moves
the brand.
recit.config.ts
To tint the background of the header search pill, set --recit- and
--recit- in the site's styles.css (falling back to --recit- and
--recit-):
styles.css
A button in the bar
header. adds one call to action, label and to: a button at the end of the bar on a wide
screen, after the theme switch, and across the menu on a phone, where following it closes the menu.
to is a route of the site or an address; an address of another site opens in a new tab. An empty
label or to is refused when the site builds.
recit.config.ts
The light/dark switch elsewhere
@recit/ exports ThemeSwitch, to place the switch in a slot of your own (the Récit
sites put it in the footer, footer-after) and set header..