Mini program title bar with a capsule

A pearl title bar whose centre shows the chapter in view and whose right is a two-part capsule: a menu that opens a service grid sheet, and a jade Ask link to the assistant.

NavigationFreeFrom Yilu, Super-appChinese or JapaneseAbout 4k tokens saved
The whole page

Scroll inside the frame to see the bar over a 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.

647 words
Download .zip
# Mini program title bar with a capsule

One navigation 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 header for a super-app or mini program brand that looks and behaves like the mini program title bar people already know.

## Structure
1. fixed bar 64px, three columns: logo left, chapter title centre, capsule right
2. logo: a 30px rounded jade tile with a line and dot mark, then the Chinese and Latin name
3. centre title: Chinese chapter name plus a smaller English name, swapped as each chapter enters the middle of the viewport
4. capsule: 40px pill with a 1px border, a three-dot menu button, a hairline divider and a jade ring icon with Ask and the assistant's name
5. bottom sheet: grip, title, close button, a 3 x 2 grid of service tiles linking to chapters, one full-width call to action

## Type
Geologica 500 and 600 for display and UI, Geologica 400 for text; Chinese in Noto Sans SC 400, 500 and 700 subsets.

## Colour
Pearl #F4F5F1, white #FFFFFF, ink #0D1411, graphite #56605B, line #DDE2DC, mint wash #E3F1EB, deep jade #007A5A for buttons and text (white on it 5.3:1), bright jade #19C58F for the scan line and the night chapter, night #0A1712.

## Spacing and lines
Side gutters clamp(16px, 4.4vw, 56px). Capsule segments 52px minimum. Sheet max 560px, 28px top radius, tiles 18px radius with 10px gaps.

## Behaviour
The bar gains a 1px bottom line after 8px of scroll and turns night green over the dark chapter. The sheet slides up over 420ms cubic-bezier(.16,1,.3,1) with a 42% ink scrim; tiles press to .97 on tap.

## Responsive
Under 720px the centre title hides and the capsule segments tighten to 12px padding.

## Accessibility
Real nav landmark; the menu button has aria-expanded and aria-controls; the sheet is a modal dialog with focus moved in, Tab trapped, Escape and the scrim closing it and focus returned.

## Built values (from code.html)
- Fonts: Geologica 400 (self-hosted: fonts/geologica-400.woff2); Geologica 500 (self-hosted: fonts/geologica-500.woff2); Geologica 600 (self-hosted: fonts/geologica-600.woff2); Yilu SC 400 (self-hosted: fonts/noto-sans-sc-400.woff2); Yilu SC 500 (self-hosted: fonts/noto-sans-sc-500.woff2); Yilu SC 700 (self-hosted: fonts/noto-sans-sc-700.woff2). Self-hosted files sit in fonts/ in the block download.
- Colour variables: --pearl #F4F5F1, --white #FFFFFF, --ink #0D1411, --graphite #56605B, --line #DDE2DC, --line-2 #C9D0C9, --mint #E3F1EB, --jade #00936D, --jade-deep #007A5A, --jade-bright #19C58F, --night #0A1712, --night-2 #12241D, --night-line #24392F, --night-text #E8EFEA.
- Font variables: --sans "Geologica", "Yilu SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif.
- Size variables: --gut clamp(16px, 4.4vw, 56px), --max 1240px, --bar 64px, --pad clamp(96px, 12vw, 176px).
- Media queries: max-width 720px, prefers-reduced-motion.
- No media files.
- Script: none, CSS only.

## Script
Set the Chinese or Japanese text in a CJK face with its own letter spacing and a looser line height than the Latin text, with strict line breaking and the palt feature on. Latin words inside a CJK line sit on the same baseline.

## Content to replace
- [Logo]: Chinese and Latin brand name
- [Chapter titles]: two to four Chinese characters with one English word
- [Ask link]: Ask plus the assistant's name

## 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.

Same page

More from Yilu

See the page