The product page
Part of Design system, which is built from DESIGN.md in the repository, where it is edited.
How the reference site's front page is written and laid out.
The reference host's page at / (packages/web/src/product) is the one full page that is not the map. It is written for a front-end engineer deciding whether to adopt the SDK, so it is ordered by what they need to decide: the hero (the h1, a one-sentence lede, Try the playground as the one filled button, the install command, View on GitHub as a text link, three badges and the latest release), the picture of the playground at work, what you get, when it fits, the licence and its cost, how ready it is, the mount, the remaining questions, then the relief strip and the footer. Each thing is said once: the release only in the hero, the services' privacy only under what you get, the frameworks in one answer that agrees with the readiness text. The type scale is the map's own on the page's wider measure: the h1 the display step (from the title step on the smallest phone, reaching the display step from about 400 px wide), section headings (h2) the title step, subheadings and benefit names (h3) the large step in the semibold weight, body text the large step (17 px) in the regular weight, the lede and each benefit's text in text-muted, and captions, labels, the badges, file names and footer text the small step (13 px). Nothing is below 13 px, which a measurement of every text node's computed size checks, the relief strip's two labels included (see "Artwork"). Reading text keeps to a 38rem measure, about 70 characters, in a page column of 72rem, so on a wide screen the short groups of a section (the benefits, the fit lists, the licence and its cost, readiness) sit side by side in a grid (as many columns as fit at 16rem or more) instead of reading as one long column. Monospace is for code, the install tabs and the badges only. Headings wrap balanced and paragraphs pretty (text-wrap). Sections are separated by space alone, two of the largest spacing steps, with no rule between them. The hairline colour is used only under the sticky header, between the questions and on the edges of a code box and the install command; the badges and the picture's frame use controlBoundary. Inside a section the blocks are one medium step apart, the first a large step under the heading; a group's or a benefit's h3 sits a small step above what it heads, and groups are the largest step apart. It is mobile first, one column at 320 px, and uses the same tokens as the map; the only additions are the display size and the code face above. The blue of the logo is a graphic colour only (the relief strip's marks), never small text; text and links stay accent.
- Header. A slim bar, one 44 px target tall, that stays at the top while the page scrolls (
position: stickyon thechromelayer), on the page's own ground with a hairline under it. It holds the brand and three text links, Playground, Docs (the README's documentation section) and GitHub, at every width and never behind a menu. It pads itself below a notch (env(safe-area-inset-top)) and the page column pads past the side insets. Anchored content lands below it: the root'sscroll-padding-block-startis the header's height plus the top inset and a step, and nothing else adds an offset (a browser test holds an anchored heading within a step of the header). The header never wraps: at very large text sizes its navigation scrolls sideways inside itself, so it stays one row, and since its height and the padding are both in rem the padding still clears it; a browser test tabs through the page with text at 200% and finds no focused control under the header. While the document scrolls, the page's container isoverflow: cliprather than a scroll container of its own, so the header sticks to the viewport; in a browser without:has()the container scrolls itself and carries the same padding. - Hero. One grid cell holds a faint contour motif and, over it, the words, so neither is positioned. From 75rem, where the install command fits its column on one line, the words are two columns: the heading, lede, button, repository link and badges at the start, and the install command at the end, centred on them; the markup's order, and so the reading and tab order, does not change. The motif is the relief strip's contours (
contours.ts), cropped from the end side so the summit sits away from the text, drawn inhairlinewith a 1 px line (2 px for an index contour) that never scales, decorative (aria-hidden,focusable="false", no text) and transparent in forced colours.hairlineis translucent, so where text crosses a contour it sits onhairlinecomposited over the page;ProductPage.test.tsxmeasures text, text-muted and the accent links against that colour at 4.5:1 or more in both themes. Try the playground is the page's one filled button (accent fill, 48 px, the full width below 30rem and its own width above); a browser test counts the filled controls at 320 and 1440 px and finds only it. The install block follows (see "Install block"), with the line that says the command also adds the three peers and what the SDK needs, then View on GitHub, an underlined text link with a 44 px target. The badges ("Targets WCAG 2.2 AA", "AGPL-3.0-only", "MapLibre GL JS",BADGES) are text in a pill edged incontrolBoundaryon the page's ground, drawn by CSS, so no image is requested; the accessibility badge says "Targets" because AA is a target the project tests against, as the text says, and the licence badge links the licence section (#licence). Under them, the latest release and its date, the page's one statement of it, with a link to the readiness section (#readiness, see "Release facts"). - Release facts. The version and the day it was released are the only facts on the page that change with each release.
releaseFacts.server.tsreads them from the first stable release heading ofCHANGELOG.md(a heading such as## 0.1.0 (2026-11-21); a release candidate such as0.2.0-rc.1is skipped, so the page names whatnpm installgives from the default tag) in the checkout the site is built from, and the route's loader passes them to the page, so the build fetches nothing, the Workers Build stays reproducible offline, and the changelog's text never reaches the browser. The build fails, rather than show something older or wrong, when the changelog's first##section is not a release (such as one for unreleased changes), when it names no stable release, or when a release's date is not a day the calendar has. The date is written from its digits (releaseDate.ts), so the build's time zone cannot move it. CI status and bundle size are not shown: neither can be read deterministically from the checkout at build time. - Picture (
DemoFigure). The page shows what the SDK makes with a real capture of the running playground, straight under the hero and the largest thing on the page: one view (the Measure tool over Cape Town) taken at two sizes. The narrow capture (400 by 520) runs edge to edge below 48rem, never wider than it was taken; the wide one (1152 by 640) is drawn from 48rem, in a 1 px frame incontrolBoundary, as wide as the screen allows up to its own width, so from about 1220 px it is drawn at full size, wider than the text. Both widths come fromcaptureSubjects.ts, which the stylesheet reads. What each shows, its size and its basemaps are one table,captureSubjects.ts; its words are inproductContent.ts, so/index.mdand/llms-full.txtcarry the same description. The alt text says it is a screenshot and what it shows; the caption says the same and that the Try the playground button above opens the real thing, with no second link to the playground. Each capture is taken at twice the device pixels, as a WebP with its size inwidthandheightattributes (so layout shift stays 0),loading="lazy"anddecoding="async". There is one image for each theme: the Bright capture by day and the Fiord capture (OpenFreeMap's blue dark style) by night, and CSS alone chooses (an explicitdata-themeon the root, else the system's preference, as the tokens do); the image for the other theme and the frame of the other size aredisplay: none, so the browser fetches one file, which a browser test counts at 390, 820 and 1440 px in both themes. Every image is lazy, on purpose: an eager image is fetched even when it isdisplay: none, so eager loading would fetch all four files, and a<picture>element, which could choose one file eagerly, cannot follow a theme chosen in the playground (data-theme) when it differs from the system's. Without a script both sizes are in the markup and only the drawn one is fetched. The credits under the picture are the ones the map itself shows for those basemaps, taken from the SDK's basemap definitions, each linked as the map links it: they are the only links on the page to those four sites (ATTRIBUTIONS.md). The pictures are made bynpm run capture:product -w @mapcairn/web(docs/guides/product-captures.md) and committed, at most 60 KB for the narrow capture, 180 KB for the wide one and 480 KB in all (one file, at most 180 KB, is fetched in a visit); a test holds each file's size, its dimensions and the budgets. The picture is not a link: the playground is one press away in the hero and the header, and the page keeps its promise that nothing of the map loads, and nothing is requested from the basemap provider, until a person goes there. - What you get. At most four benefits, accessibility and privacy first, written in plain words as what each lets you do rather than how it is built (no "live region", "proxied", "feature cards" or "contract suite"; a test holds the words out): each is an h3 and a paragraph in text-muted, with no icon, card, border or shadow, one column on a phone and two from 48rem. It is a
featuresblock inproductContent.ts, which/index.mdand/llms-full.txtrender as headings with their text. - When it fits. Two groups of list items, "It fits a team that" and "It does not fit if you need", side by side on a wide screen. The second names the real disqualifiers: no prebuilt bundle for pages without React, only Vite tried, one volunteer maintainer, and that the AGPL-3.0 asks you to offer the source of an app you distribute with the SDK inside.
- Licence and cost, and how ready it is. Two sections of plain prose in short groups with h3 headings, always shown and never behind a disclosure: what the AGPL-3.0 asks of an app that embeds the SDK and what it costs; then readiness, which opens with the plain answer (
STATUS_LINE) and has where it runs, what has been tried and what it lacks. Every sentence comes fromsites/docs/docs/guides/licence.md, the README,AGENTS.md,ROADMAP.mdandsites/docs/docs/guides/extending.md, and the licence guide is linked as not legal advice. See "What the page says about the licence and status". - Code example. "Embed a map" says the install command adds the SDK and its peers and that a whole app is three files, then shows one excerpt, the part that mounts the map: the README's
MapScreen(MapViewwith a starting view, a basemap and the SDK's interface round it), fourteen lines, cut from the README'smain.tsxbyexcerptOfso it cannot differ from the filepackages/core/src/lint/readme.test.tstype-checks. Straight under it a paragraph says search and the rest of the interface run on in-memory stand-ins until you add adapters and that the map asks a public tile provider for its tiles; the last paragraph links the embedding walkthrough (sites/docs/docs/guides/embed-a-map.md) for the three files, what each part does and the Content Security Policy, and the example app. The code sits in a box (a hairline edge onsurfaceRaised): a top row with the file's name at its start and the copy button in its corner, over aprethat scrolls inside the box (at most 26rem tall), is a named region (named for the excerpt) and takes focus (tabindex="0"), so the keyboard can reach and scroll it and it never widens the page. The TSX is highlighted with the existing roles only, through classes rather than inline styles (highlightCode.ts): keywords in the accent, strings, numbers and comments in text-muted, and component and type names in the semibold weight; the region's text is the source exactly. - Copy buttons.
CopyCodeButtonis a 44 px icon button with no frame of its own, in the corner of its code; its accessible name says what it does and what it copies ("Copy code, src/main.tsx, an excerpt"). It copies through the host's clipboard adapter, built on its own incomposition/productClipboard.tsso the page still loads no map code, writes only when pressed and never moves focus. Its icon shows the outcome: a check in the accent once copied, back to the copy icon four seconds after the latest successful copy, or a cross in the danger colour until the next try, and its name changes with it ("Copied, …", "Copy failed, …"). If clicks overlap, only the latest click's outcome is shown and announced, and the button is never disabled. The outcome is also announced through the page's ownLiveRegionProvider, withkeepsince the person asked for it: "Code copied, …" politely, or "Could not copy …. Select the code and copy it manually." assertively, and the code stays selectable by hand. Under a pointer and pressed it takes the accent tint; in forced colours a hovered button is outlined. - Install block. In the hero, after the playground button (beside the words from 75rem), a native radio group named "Package manager" (a
fieldsetwhoselegendis visually hidden) offers npm, pnpm, yarn and bun as quiet tabs: monospaced small labels in text-muted, each a 44 px target, the chosen one in the text colour with a 2 px underline in the accent, so colour is not the only sign (the underline's colour isHighlightin forced colours). Each manager's command is in a code box beneath:npm install,pnpm add,yarn addorbun addwith@mapcairn/sdkand the peersreact,react-domandmaplibre-gl(INSTALL_OPTIONSinproductContent.ts, which/index.md,/llms.txtand/llms-full.txtlist as one block). The command wraps at its spaces instead of scrolling and keeps room at its end for the copy button, whose row a negative margin draws up into the command's end corner, in flow and never positioned, so a phone shows all of it and nothing covers it. The radios are real inputs, visually hidden inside their tabs' labels, so the arrow keys, the single tab stop and their direction come from the browser (the page's left-to-right root is the only thing that sets it), with the focus ring drawn on the tab by:has(input:focus-visible). It works without a script: the server renders every command and npm chosen, and CSS (:has(input:checked)) shows only the chosen manager's command. Where:has()is not supported the hiding rule is skipped (@supports selector(:has(*))), so all four commands show, each in its region named for its manager. The copy button, the one part that needs a script, appears once the page runs, in the corner the command already leaves free, so nothing moves; its name and announcements name the command the way the example names its file ("Copy code, pnpm install command"). The choice is read back from the radios when the page starts, so one made before then is the one copied. Nothing is stored. - Questions. Native
detailsandsummary, for the questions the sections above do not answer: which packages it installs, which frameworks it works with and what the playground uses (with what the reference site sends). The whole row is the target, at least 48 px tall, with a chevron in the text colour at its end that turns when it is open (motion.duration.base, which reduced motion brings to near zero); a hairline separates the rows, and the answer is in the page's markup whether open or not.faqEntriesbuilds the FAQ structured data from these questions only. - Interaction states. Every button and link answers the pointer, quietly. Hover applies only under
(hover: hover), so a tap never leaves a stuck hover; pressed (:active) applies everywhere. The filled button rises 1 px onto the floating shadow under a pointer, and pressed it drops the lift and shadow and shrinks to 98 percent; the hover gives way to the focus ring, which is partly a shadow. The header links, View on GitHub, the copy buttons and the install tabs take the accent tint under a pointer and when pressed, and every underlined link doubles its underline to 2 px under a pointer. The brand is not underlined at rest: under a pointer it gains a 2 px underline. Every state uses colour pairs the theme tests hold to AA in both themes, never opacity. Onlytransformanimates, atmotion.duration.fastwithmotion.easing, which reduced motion brings to near zero. In forced colours the tint and shadow are dropped, so a hovered button is underlined, the header links are underlined at rest, and the filled button becomes an outlinedLinkTextlink onCanvasin every state, because forced colours paint aCanvasbackplate behind text that would hide aHighlightTextlabel on aHighlightfill. - Artwork (
SurveyArt). The relief strip: inline SVG in the page's own code, decorative (the frame and the SVG arearia-hidden,focusable="false"), its two figures invented and relied on by nothing in the page's text, drawn once, at the end of the page after the last section and before the footer, where the way ends at the cairn. It is a strip of a made-up survey sheet (scripts/generateContours.mjs, committed as data, a contour every 50 m and an index contour every 250 m): faint contour lines in the muted ink, a cairn on the summit, a dropped pin and the dashed line measured from the pin to the cairn, the three survey marks in the logo's blue (mapMeasureLineandmapPin, a graphic colour, never text), in a 1 px neatline incontrolBoundary. Its contours are the hero's motif, so the page opens and closes on the same sheet. The drawing holds no text. Its two labels, the summit's height and the line's length, are HTML spans at the small step (13 px) in the page's text colour on a plate of the page's own ground, set beside the cairn (on its start side, so the label has room at any text size) and at the line's middle by percentages of the frame thatsurveyGeometry.tsworks out for each crop, so they are 13 px at every width and never scale with the drawing; the length is the line's own length on the sheet's scale, written as the measure tool writes it. Every position comes fromsurveyGeometry.ts, so the marks agree by construction, andsurveyGeometry.test.tsande2e/product-strip.spec.tscheck it, with the labels' size and that each lies whole inside the frame, at 320, 390, 820 and 1440 px in both themes. The strip is 640 units wide and drawn at one pixel to the unit at most (40rem); below 36rem the same drawing is shown enlarged round the pin, the line and the cairn (NARROW_CROP), and the two crops are one function of a box (cropOf). Every colour is a token through a class and every line keeps its width at any size (vector-effect: non-scaling-stroke). Nothing moves, so reduced motion changes nothing. In forced colours the marks and labels takeCanvasTextandCanvasand the stones' haloCanvas. - Link preview cards. The two share images,
public/og-sdk.pngfor/andpublic/og-image.pngfor the playground and the pages around it, are one design in two sets of words (src/product/shareCard.ts;scripts/generateSdkOgImage.tsandscripts/generateOgImage.tseach pass their words toscripts/renderShareCard.ts, which has Playwright's Chromium draw the card, so no image library is needed). Both are 1200 by 630 on the light theme's paper (pageBackground), with the favicon's tile and the name at the top, the headline in IBM Plex Sans semibold at 68 px and a one-line lede intextMutedunder it, and the address in theaccentlink ink, all at least 4.5:1 on the paper. At the end edge is the page's survey sheet as a plate in a 2 px neatline incontrolBoundary: the same contours, pin, dashed measured line and cairn as the relief strip, from the samesurveyGeometry.ts, cropped round the marks so the cairn is about 80 px wide, with grid ticks on the plate's top and start edges and the strip's two figures at 24 px. The survey marks are the logo's blue (mapPinandmapMeasureLine, 3:1 or more on the paper, a graphic colour, never text) and every colour is one of the card's inks, whichshareCard.test.tschecks, with the contrast ratios, the sizes that stay readable at 300 px wide, that the product card's headline is the page's h1 and that the two cards differ only in their words. The product page's card says the page's h1 and "An open-source React SDK for public-interest maps."; the playground's says "The MapCairn playground" and "Search places, compare basemaps and measure distances or areas." They hold no map tiles and no text beyond those words, the address and the two figures, so they need no attribution. Each stays under 150,000 bytes and its size is the one itsog:image:widthandog:image:heighttags state (siteIdentity.test.ts). Regenerate both withnpm run generate:og-sdk -w @mapcairn/webandnpm run generate:og-image -w @mapcairn/webwhen the headline, the relief strip's geometry or the brand colours change, and look at the result at full size and at 300 px wide. The favicon, apple-touch and manifest icons are unchanged: the blue tile with white stones (#94c1faand#062d59in dark) already holds at 16 px. - Links. Plain anchors with descriptive names, same tab. The repository's front page is linked from three places: the header's GitHub, the hero's View on GitHub and the footer's Source code. The playground is linked from three: the header, the hero's button and the footer. Past the front page the page links a short, named set of pages an adopter looks for next (
REPOSITORY_PAGESinproductContent.ts, listed in the footer): the documentation (the documentation site's front page,https://docs.mapcairn.com/, which the header names Docs), the release notes (the repository's releases page), the licence guide, the security policy and Discussions. The text also links the capability matrix (in the readiness section), the embedding walkthrough (sites/docs/docs/guides/embed-a-map.md) and the example app (examples/embed), both once, in "Embed a map". The licence badge and the release line link the page's own#licenceand#readiness. Nothing else past the front page: no issue, pull request, milestone, README section, other file or contributing page. The page does not link the npm package; the install command names it, and/llms.txtlinks it.publishedText.test.tsxholds the page, its structured data,/index.md,/llms.txtand/llms-full.txtto the set, each page with its reason. Every other link is to this site, apart from the project's Mastodon profile in the footer and the map credits under the picture (OpenStreetMap's copyright page, OpenFreeMap, OpenMapTiles and MapLibre). A link in running text has block padding so its hit area is at least 24 px (WCAG 2.5.8) without changing the line. - Footer. "Built with love in South Africa.", with the Phosphor heart through
Iconwithfilled, in the accent and hidden from assistive technology, so the words carry the meaning; the licence as plain text; then the links, wrapping onto as many rows as they need, each a 44 px target, in two lists a small step apart: the project's ("Source code", "Documentation", "Release notes", "Licence guide", "Security", "Discussions", "Mastodon" withrel="me") and the site's own ("Try the playground", "Privacy policy"). Its bottom padding adds the safe-area inset. The benefit, badge and footer lists are plainulelements withlist-style: none, which Safari with VoiceOver stops announcing as lists; they do not addrole="list"because Biome'snoRedundantRolesrule, which the lint enforces, rejects it, and the content reads in order either way. - What the page says about the licence and status. The licence section says the AGPL-3.0-only "allows commercial use", the README's own words and the only wording about commercial terms the page may use (a test removes that phrase and fails on any other mention); that the condition is that the source stays available, so an app distributed with the SDK inside, including by serving it to browsers, is offered under the AGPL-3.0 with its corresponding source; that an app only the organisation's own staff use is not distributed; and that a modified SDK used over a network must offer its source, as
sites/docs/docs/guides/licence.mddoes. It says nothing about any other licensing or terms, and nor does any text the page publishes (publishedText.test.tsxchecks the page, its structured data,/index.mdand thellmsfiles). The readiness section opens withSTATUS_LINE(that the SDK is before version 1.0 and not stable, and a minor release can change the public API; it goes when 1.0 ships), then says the reference site runs on the SDK in production and every change passes the unit, browser and accessibility tests, that the published packages are checked in a plain Vite and React app in Chromium and the reference site's browser tests run in Chromium and WebKit, that other frameworks and bundlers have not been tried, and what it lacks: no prebuilt bundle for pages without React, and one volunteer maintainer (ROADMAP.md). "What does the playground use?" says the playground's search, directions and data layers are the reference site's own adapters and definitions, on public community services (Nominatim, the FOSSGIS Valhalla server) that are not meant for other sites' production traffic, what the reference site sends and to whom, and that the SDK ships the interface, the MapLibre adapter and in-memory fakes. - Language. English only, by decision; the page's root carries
lang="en-GB", its text is inproductContent.ts(the copy button's words too), and the one file that renders text inline,ProductPage.tsx, is listed in the copy check's allowlist. It describes the design rather than counts or plans, links to no issue, pull request or milestone, and leaves what is current to the repository's documentation and the changelog (publishedText.test.tsxandProductPage.test.tsxcheck these rules and the links), so a change to the SDK normally needs nothing on it.