Skip to Content
ReferenceTypes

AriaLabelConfig

Source on GitHub 

With the AriaLabelConfig you can customize the aria labels used by React Flow. This is useful if you want to translate the labels or if you want to change them to better suit your application.

Fields

NameTypeDefault
node.a11yDescription.defaultstring
node.a11yDescription.keyboardDisabledstring
node.a11yDescription.ariaLiveMessage({ direction, x, y }: { direction: string; x: number; y: number; }) => string
edge.a11yDescription.defaultstring
controls.ariaLabelstring
controls.zoomIn.ariaLabelstring
controls.zoomOut.ariaLabelstring
controls.fitView.ariaLabelstring
controls.interactive.ariaLabelstring
minimap.ariaLabelstring
handle.ariaLabelstring

Default config

const defaultAriaLabelConfig = { 'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.', 'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.', 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }: { direction: string; x: number; y: number }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`, 'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.', // Control elements 'controls.ariaLabel': 'Control Panel', 'controls.zoomIn.ariaLabel': 'Zoom In', 'controls.zoomOut.ariaLabel': 'Zoom Out', 'controls.fitView.ariaLabel': 'Fit View', 'controls.interactive.ariaLabel': 'Toggle Interactivity', // Mini map 'minimap.ariaLabel': 'Mini Map', // Handle 'handle.ariaLabel': 'Handle', };
Last updated on