diff --git a/.changeset/nine-cougars-turn.md b/.changeset/nine-cougars-turn.md new file mode 100644 index 00000000..eb6f3776 --- /dev/null +++ b/.changeset/nine-cougars-turn.md @@ -0,0 +1,5 @@ +--- +'@reactflow/minimap': minor +--- + +add a new property "ariaLabel" to configure or remove the aria-label of the minimap component diff --git a/packages/minimap/src/MiniMap.tsx b/packages/minimap/src/MiniMap.tsx index f2487f18..42ceccce 100644 --- a/packages/minimap/src/MiniMap.tsx +++ b/packages/minimap/src/MiniMap.tsx @@ -38,7 +38,6 @@ const selector = (s: ReactFlowState) => { const getAttrFunction = (func: any): GetMiniMapNodeAttribute => (func instanceof Function ? func : () => func); const ARIA_LABEL_KEY = 'react-flow__minimap-desc'; - function MiniMap({ style, className, @@ -53,6 +52,7 @@ function MiniMap({ onNodeClick, pannable = false, zoomable = false, + ariaLabel = 'React Flow mini map', }: MiniMapProps) { const store = useStoreApi(); const svg = useRef(null); @@ -155,7 +155,7 @@ function MiniMap({ ref={svg} onClick={onSvgClick} > - React Flow mini map + {ariaLabel && {ariaLabel}} {nodes.map((node) => { return ( = Omit, ' onNodeClick?: (event: MouseEvent, node: Node) => void; pannable?: boolean; zoomable?: boolean; + ariaLabel?: string | null; };