FlowMiniMap

A scaled SVG overview of the graph with a draggable viewport rectangle.

Category: display · WCAG 2.1-AA · flow, minimap, overview, chrome

Props

PropTypeDefaultDescription
nodesFlowNode[]The nodes to render.
viewportViewportThe current pan/zoom viewport to reflect in the minimap.
containerWidthnumberWidth of the flow container, used to scale the minimap.
containerHeightnumberHeight of the flow container, used to scale the minimap.
widthnumber200Width in px.
heightnumber150Height in px.
position'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'bottom-rightCanvas corner the minimap is pinned to: `bottom-right`, `bottom-left`, `top-left` or `top-right`.
onViewportChange(viewport: Viewport) => voidCalled with the new viewport when the minimap is dragged.
classNamestringAdditional CSS class names merged onto the root element.
ariaLabelstringAlias of `label` — the same invisible accessible name under the catalog spelling. Neither is deprecated.
labelstring | undefinedAccessible name for the minimap region.
nodeColorstring | undefinedFill colour for node rectangles in the minimap.

Design tokens

When to use

When not to use

Examples

Graph overview

() => (
  <FlowMiniMap
    nodes={[
      { id: 'a', position: { x: 0, y: 0 } },
      { id: 'b', position: { x: 220, y: 120 } },
      { id: 'c', position: { x: 440, y: 0 } },
    ]}
    viewport={{ x: 0, y: 0, zoom: 1 }}
    containerWidth={400}
    containerHeight={300}
  />
)

Related components

← Back to docs