🚀 Born from GitLab’s need for better diagram accessibility

SVG Toolbelt

Professional-grade SVG interaction toolkit with zero dependencies. Transform any SVG into an accessible, zoomable, and pannable experience.

View on GitHub
~3KB
Gzipped Size
0
Dependencies
8+
Features
98%+
Test Coverage

Why SVG Toolbelt?

Built with real-world needs in mind, from GitLab’s documentation platform to enterprise applications.

🔍

Smooth Zoom & Pan

Mouse wheel zoom with cursor precision, click-drag panning, and smooth animations.

📱

Mobile-First

Optimized touch gestures, pinch-to-zoom, and responsive UI for all devices.

♿

Accessibility Champion

WCAG 2.1 AA compliant with full keyboard navigation and screen-reader support.

🧩

Modular Architecture

Feature-based design – use only what you need. Tree-shakeable and extensible.

🪶

Zero Dependencies

Lightweight ~3KB bundle with no external libraries. Built with modern TypeScript.

🎨

Framework Agnostic

Works with React, Vue, Angular, or vanilla JS. Complete TypeScript definitions.

Interactive Demos

Try out features with real diagrams and visualizations. Works with Mermaid diagrams, custom SVGs, and any vector graphics. Use mouse wheel, drag, keyboard shortcuts (+, –, 0, arrows), or touch gestures.

Loading SVG Toolbelt v0.7.0 from CDN…

Quick Start Guide

Get started with SVG Toolbelt in just a few lines of code.

# Installation
npm install svg-toolbelt
# Or with yarn
yarn add svg-toolbelt
// Basic Usage
import { initializeSvgZoom } from 'svg-toolbelt';
import 'svg-toolbelt/dist/svg-toolbelt.css';
// Enhance all .mermaid containers
initializeSvgZoom('.mermaid');
// Advanced Configuration
import { SvgZoom } from 'svg-toolbelt';
const container = document.querySelector('#my-diagram');
const enhancer = new SvgZoom(container, {
minScale: 0.2,
maxScale: 8,
controlsPosition: 'bottom-right',
enableKeyboard: true
});
enhancer.init();

Ready to Enhance Your SVGs?

Join developers making their diagrams more accessible and user-friendly.