Skip to main content

Topography

Abstract topographic background field.

No assets yet

…
<section style="position: relative; isolation: isolate">
<mm-topography seed="3" fade="edges"></mm-topography>
<h2>No assets yet</h2>
</section>

<!-- Zero JS, from @marmotdata/css: one fixed sheet drawn by the container itself. -->
<section class="mm-topography mm-topography--fade-edges">…</section>

Guidance​

Topography is a background field, never an icon or an illustration. It is an unbounded survey sheet: hairline isolines that run off every edge, cropped by the box they sit in, with no closed island, frame, tile or plate. The lines are mixed from --mm-rule, every fifth (index) line only a touch stronger, so text over the field keeps its full contrast in Light and Peat. Use at most one per view, behind a moment that has room for it: an empty or error state, sign-in, a marketing hero or closing band.

The element is absolutely positioned to fill its containing block and sits at z-index: -1, so give the container position: relative; isolation: isolate and put the field first. It is decorative (aria-hidden, pointer-events: none) and deterministic from seed, so it server-renders and never measures. For a zero-JS page use the .mm-topography class from @marmotdata/css, which draws one fixed sheet.

Properties​

PropertyAttributeTypeDefaultDescription
seedseednumber1Ground seed. The same seed always gives the same sheet.
densitydensityTopographyDensity'normal'sparse carries about ten lines, normal about eighteen.
fadefadeTopographyFade'none'Where the field dissolves: none, edges, start or end (logical, flips in RTL).

CSS parts​

PartDescription
fieldThe SVG.

CSS custom properties​

PropertyDescription
--mm-topography-lineColour of ordinary isolines. Defaults to --mm-rule at 70%.
--mm-topography-indexColour of every fifth (index) line. Defaults to --mm-rule.

Examples​

Every state of mm-topography in Storybook, with keyboard and screen reader tests.