SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

Map foundations

What @sdxc/ui/map is for, the server-first rules its maps share, and every variable it reads.

Places on a map beside the list they belong to: price pins for stays, a courier riding a route, a pin that lights up while its row is hovered.

A map renders on the server, so its pins are real links before any script loads. `GeoMap` then hands the same markers to MapLibre for dragging and zooming; `MapCanvas` stays a drawing.

typescript
import "@sdxc/ui/theme.css";
import { … } from "@sdxc/ui/map";

When to reach for it

  • Search results whose rows and pins should point at each other.
  • A delivery or ride whose marker moves along a route as it streams.
  • A listing's location, drawn in the page with no third-party map.
  • A real map of places by longitude and latitude, with clusters and "search this area".

Shared ideas

  • Pins are linksA pin with href is an <a>, otherwise a button that can open a popover; both work without script.
  • One coordinate spaceArt, routes, markers and pins share the stage's viewBox, so a crop moves all of them together.
  • Linked by keyRows and pins sharing a data-map-key light each other through mapLink or one MapCanvasSync.
  • Real streets, or your ownGeoMap draws OpenFreeMap's light and dark streets by default; pass a GeoJSON region you ship, or another style URL, as basemap.
  • Progress as a variableA route marker reads --ui-map-progress, so any island moves it by setting one property.

CSS variables

Every custom property the namespace reads or declares, with its default and what it controls.

Reads the neutral role for pins, hairlines and surfaces, and brand for routes, markers and a brand-toned pin. The roles are documented on Theming.

Stage and pins

Set on the map or an ancestor to restyle every part at once.

VariableDefaultWhat it controls
--ui-map-radius0.75remThe corner of the map's stage.
--ui-map-groundthe neutral tintThe stage's fill behind the art.

GeoMap basemap

Each defaults to a mix with the page background, so the map follows dark mode.

VariableDefaultWhat it controls
--ui-map-landa tint of the backgroundLand polygons.
--ui-map-watera blue mixSeas, lakes and rivers.
--ui-map-parka green mixParks and woods.
--ui-map-roadthe raised surfaceRoads, major ones wider.
--ui-map-labelthe muted textPlace names.

Routes and markers

VariableDefaultWhat it controls
--ui-map-route-colorthe brand solidA route's line.
--ui-map-route-width3A route's line width, in viewBox units.
--ui-map-marker-colorthe brand solidThe default marker's dot.
--ui-map-progressthe `progress` propHow far along its route a marker sits, from 0 to 1.
@sdxc/ui

Can’t find it? Contact us