Map
Maps that cost nothing per view — MapLibre (open source) over Protomaps tiles on the Krizaka CDN, painted from the tokens in dark or light and in the product's accent — with markers, clusters, the person's position, a radius and a location picker.
- Domain
- Geolocation & maps
- Support level
- Size
- 12.7 kB gzip, budget 17.3 kB
- Who uses it
- 6 files of the live products and sites import it (Folioviv: 3) Counted in the dated inventory of 2026-11-23.
import { Map, Marker, Cluster, UserPosition, RadiusCircle, Route, Pulse, LocationPicker, StaticMap, mapStyle, distanceMeters, formatDistance, pathLength, pointAlong, sliceLine } from "@krizaka/ui/map";Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.
Why it is here. Used by Folioviv.
When to use
- To show where things are: pick-up points, creators near you, an event's venue.
Clusterfor many points (dozens to thousands): they group while close and open by zooming in.LocationPickerto choose a place: a meeting point, a delivery address, the centre of a search with its radius.StaticMapwhere a live map is too much (a card, a list, an e-mail) and as thefallbackof everyMap.
When not to use
Installation
Install
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Import
import { Map, Marker, Cluster, UserPosition, RadiusCircle, Route, Pulse, LocationPicker, StaticMap, mapStyle, distanceMeters, formatDistance, pathLength, pointAlong, sliceLine } from "@krizaka/ui/map";Examples
Places
Pick-up points in Montréal: markers are buttons, the chosen one shows its name.


Cluster
Sixty creators grouped while they are close; a group opens by zooming in.


Location picker
A meeting point under the pin, its distance from the person, a 1-km zone and Near me.


Full-screen map
A map that is the whole screen takes the wheel and one finger with gestures="map"; in a page the default leaves them to the page.


Route
A delivery: pins that drop, a route that draws itself, a courier that travels it, a demand pulse — still under reduced motion.


Place sheet
A non-modal sheet over the map (snap points on a phone, a side card from md): an info card with one action and a route card that opens the person's own navigation app.
Pins
MapPin in its three shapes (drop, disc, the Cahier's tag) and four states (default, selected, visited, closed): the state is said by shape as well as colour.
Static map
The places on the map's paper, without an engine: a card, a list item, a fallback.
Props
LocationPicker
A position picked by moving the map under a pin; its distance from the person; "near me" on request.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | The picker's accessible name ("Meeting point"), passed translated. |
localerequired | string | — | The BCP 47 locale of the distance. |
onValueChangerequired | (value: LngLat) => void | — | Called when the map rests on a new position. |
valuerequired | LngLat | — | The chosen position (controlled): the centre of the map. |
brand | BrandId | — | The product whose accent the map carries. Default krizaka. |
className | string | — | Classes merged on the root (its height: h-80, aspect-video). |
fallback | ReactNode | — | Shown in place of the map while its engine loads, and for good without WebGL: a StaticMap, a picture. |
labels | Partial<LocationPickerLabels> | — | The words, passed translated; English by default. |
lang | string | — | The language of the labels (fr, en). Default en. |
origin | LngLat | null | null | Where the person is, when the app already knows it (the distance chip shows at once). |
radius | number | — | A radius in metres drawn around the chosen position (a delivery zone, a search radius). |
region | MapRegion | null | — | The detailed region (PMTiles) drawn from zoom 6.5. Default: our Montréal–Québec extract (to zoom 14). |
scheme | MapScheme | — | The scheme: auto (default) follows the page (html.light) as it changes; dark or light pins it. |
world | MapRegion | null | — | The world's low zooms (PMTiles). Default: our world extract (to zoom 6). |
zoom | number | 14 | The zoom at first. Default 14. |
Cluster
Many points grouped while they are close: a disc with the count, opened by zooming in; each point is listed for screen readers.
| Prop | Type | Default | Description |
|---|---|---|---|
pointsrequired | readonly ClusterPoint[] | — | The points: many of them (creators, pick-up points, events). |
onPointPress | ((point: ClusterPoint) => void) | — | Pressing a single point. A group zooms in to open itself. |
radius | number | 48 | The radius, in pixels, within which points group. Default 48. |
MapRoot
A map: MapLibre over our Protomaps tiles, styled from the tokens, with its places as a list for screen readers.
| Prop | Type | Default | Description |
|---|---|---|---|
centerrequired | LngLat | — | Where the map looks at first: longitude, latitude. |
labelrequired | string | — | The map's accessible name ("Pick-up points near you"), passed translated. |
brand | BrandId | — | The product whose accent the map carries. Default krizaka. |
children | ReactNode | — | Markers, circles, clusters, the user's position — and anything drawn over the map. |
className | string | — | Classes merged on the root (its height: h-80, aspect-video). |
controlled | boolean | — | The camera follows center and zoom when they change (flies, or jumps under reduced motion). |
controls | boolean | true | The zoom buttons (default) — the keyboard also zooms with + and − on the focused map. |
fallback | ReactNode | — | Shown in place of the map while its engine loads, and for good without WebGL: a StaticMap, a picture. |
gestures | MapGestures | page | Who owns the wheel and the fingers. page (default): the wheel and one finger scroll the page past the map; the map zooms
with Ctrl/⌘ + wheel, two fingers and the buttons, and a short hint says so. map: the map is the screen (full height) and
takes every gesture. |
interactive | boolean | true | Moves with the hand (default); false makes a still picture of a place. |
labels | Partial<MapLabels> | — | The words, passed translated; English by default. |
lang | string | — | The language of the labels (fr, en). Default en. |
onMoveEnd | ((view: { center: LngLat; zoom: number; }) => void) | — | Called when the camera rests: its centre and zoom. |
onPress | ((position: LngLat) => void) | — | Called with the position pressed on the map (not on a marker). |
region | MapRegion | null | — | The detailed region (PMTiles) drawn from zoom 6.5. Default: our Montréal–Québec extract (to zoom 14). |
scheme | MapScheme | auto | The scheme: auto (default) follows the page (html.light) as it changes; dark or light pins it. |
variant | MapVariant | — | The look: plain (default), notebook (the Cahier: paper and ink, manila tags for clusters). |
world | MapRegion | null | — | The world's low zooms (PMTiles). Default: our world extract (to zoom 6). |
zoom | number | 12 | The zoom at first (0 the world, 12 a city, 16 a street). Default 12. |
Marker
A place on the map: an accent dot (or your content) that is a button when it does something.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | Its words: the place's name, read in the list of places and as the button's name ("Café Olimpico, 350 m"). |
positionrequired | LngLat | — | Where it stands. |
children | ReactNode | — | What it draws instead of the accent dot (an avatar, an icon). |
drop | number | — | Drops onto its place once, after this many milliseconds (stagger several: index * 90). Still under reduced motion. |
onPress | (() => void) | — | Pressing it (details in a panel, a sheet): the marker becomes a button. |
selected | boolean | — | The chosen one: larger, its label shown above it. |
size | number | 18 | Its size in pixels. Default 18. |
Pulse
A heat pulse: rings that swell and fade around a place (a hot spot, a demand peak). Still rings under reduced motion.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | Its words ("High demand in Mile End"), read in the list of places. |
positionrequired | LngLat | — | Where it beats. |
size | number | 56 | The rings' reach in pixels. Default 56. |
tone | "accent" | "soft" | accent | accent (a zone that matters) or soft. Default accent. |
RadiusCircle
A circle on the ground: a delivery zone, a search radius — filled with the accent, its edge drawn.
| Prop | Type | Default | Description |
|---|---|---|---|
centerrequired | LngLat | — | Its centre. |
radiusrequired | number | — | Its radius in metres. |
tone | "accent" | "soft" | accent | accent (a zone that matters: a delivery area, a search radius) or soft (an accuracy). |
Route
A route on the map: a line that draws itself, and a courier that travels it. Under reduced motion the line is whole and the courier rests at the end.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | Its words ("Delivery from the studio to Mile End, 2.4 km"), read in the list of places. |
pathrequired | readonly LngLat[] | — | The path, as positions in order (a polyline: a delivery, a walk, a flight). |
courier | ReactNode | — | A dot that travels the route once drawn (true, or your own content: an avatar, an icon). |
draw | boolean | true | The line draws itself once, from its start, when the map is on screen; false shows it whole. Default true. |
duration | number | 1400 | How long the drawing lasts, in milliseconds. Default 1400. |
easing | "linear" | "ease-in-out" | "ease-out" | — | The timing function of the drawing and of the trips: ease-out, linear, ease-in-out. Default: out for the drawing, in-out for a trip. |
paused | boolean | false | Holds the drawing and the trips where they are (a controlled pause, on top of the off-screen one). |
repeatAfter | number | — | Start the trips again after a pause (milliseconds), only while the map is on screen. Without it the courier makes one trip. |
replayKey | string | number | — | Changing it replays the drawing and the trip. |
tone | "accent" | "soft" | accent | accent or soft. Default accent. |
tripDuration | number | 3200 | How long a trip takes, in milliseconds. Default 3200. |
UserPosition
The person's position: a dot that pulses (still under reduced motion), its accuracy as a soft disc.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | Its words ("You are here"), read in the list of places. |
positionrequired | LngLat | — | Where the person is. |
accuracy | number | — | The accuracy in metres: a soft disc around the dot. |
StaticMap
A still map: the places on the map's paper (or on a snapshot), named in words.
| Prop | Type | Default | Description |
|---|---|---|---|
centerrequired | LngLat | — | The centre of the picture. |
labelrequired | string | — | What the picture shows, in words ("Three pick-up points in the Plateau"), passed translated: its accessible name. |
className | string | — | Classes merged on the root (its size). |
image | string | — | A snapshot of the real map of the area (same centre and zoom), drawn under the places; the attribution then shows. |
places | readonly StaticMapPlace[] | [] | The places drawn on it (an accent dot each), listed in its name. |
zoom | number | 12 | The zoom of the picture. Default 12. |
Accessibility
- The canvas is hidden from assistive technologies: the places are read as a list (each
Marker,Clusterpoint and the person's position by itslabel). - A marker with
onPressis a button named by its label (aria-pressedwhen it can be chosen); the chosen one shows its name above it. - Under reduced motion the camera jumps instead of flying and the position's pulse stands still.
- Colours come from the tokens: the water is the accent softened, roads and labels the text roles — readable in both schemes.
Keyboard
| Keys | Action |
|---|---|
| Tab | The map (a region named by label), then its buttons: zoom, the markers that do something, Near me. |
| Arrow keys | Pan the focused map. |
| Ctrl / ⌘ + wheel | Zoom the map; a plain wheel scrolls the page (unless gestures="map"). |
| + / − | Zoom the focused map in or out. |
Best practices
- Give every map a
labeland every marker alabel: they are read as the list of places in place of the map. - Always pass a
fallback(StaticMapwith the same centre and places): it shows while the engine loads and for good without WebGL. - Motion on a map:
Marker drop={index * 90}drops pins in turn,Routedraws its line once (and acouriermakes one trip,repeatAfterrepeats it while the map is on screen),Pulsebeats around a hot spot. The drawing is finite — nothing runs afterwards — and everything is in place at once under reduced motion. - Ask for the position only on a press (
LocationPicker's Near me), never on load; every refusal has its words. variantis the look:plain(the product register, default),notebook(the Cahier — paper and ink, a cluster as a manila tag, a lone place in the margin's red).scheme="auto"(default) follows the page;darkorlightpins it. Both come from the tokens — never a hand-written map style.MapPin(from@krizaka/ui/map/pin) is the marker's face when the dot is not enough: put it in aMarker's children. Its state is also said by shape (hollow visited, dashed closed, larger selected).- In a page the wheel scrolls the page, not the map (
gestures="page", the default): the map zooms with Ctrl/⌘ + wheel, two fingers on a phone and its + / − buttons, and the engine's overlay says so in the map's words (labels.gestureHelp: MapLibre'sCooperativeGesturesHandler.*HelpTextkeys). A map that IS the screen (an explorer, full height) opts in withgestures="map". - Keep the attribution visible (OpenStreetMap's licence, the ODbL, asks for it): the components draw it.
- Import the place sheet from
@krizaka/ui/map/sheet(MapSheet) and the cards from@krizaka/ui/map/cards(MapInfoCard,RouteCard,routeLinks): their own entries, so a page that only draws a map does not pay for them. - Install the engine only where a map is shown:
maplibre-gl(web) or@maplibre/maplibre-react-native(Expo) — optional peers.
Related components
Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub