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.
viewportViewport—The current pan/zoom viewport to reflect in the minimap.
containerWidthnumber—Width of the flow container, used to scale the minimap.
containerHeightnumber—Height 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) => void—Called with the new viewport when the minimap is dragged.
classNamestring—Additional CSS class names merged onto the root element.
ariaLabelstring—Alias of `label` — the same invisible accessible name under the catalog spelling. Neither is deprecated.
labelstring | undefined—Accessible name for the minimap region.
nodeColorstring | undefined—Fill 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