slicksvg
split screen web based svg editor
____ ____ ____ _______ _____ _____
_/ _//__ | / / V __/__\ | / /
_\___ \: | | | |/ Y :/ /
\ | | | | | | | / \
| : | |____| |__ : | \ \
:____ | : / | \ |_____\ svg \
\____/ \______/ \__/ \____/ \_____/
https://github.com/xero/slicksvg
A Node.js-based, web SVG editor written in TypeScript, with no frontend frameworks. The UI and all interactions are managed using vanilla TypeScript, DOM APIs, and modern browser features. The app provides a full-screen split view for editing and previewing SVG code in real time.
Features: Real-time editing • Resizable split view • Xray mode highlighting • Dark/light themes • SVG optimization • Transform tools • Mobile / Touch support • Comprehensive testing
Light Mode with Xray Highlighting:
Dark Mode with Error State:
> [!NOTE] > You can use bun or npm (bunx / npx) interchangeably in all examples. > For building, you may use the convenient shortcut: bun bake (same as bun run build).
Install dependencies:
bun install
Start the development server:
bun run dev
# or
npm run dev
Build the project (single-file ready):
bun bake
# or
bun run build
# or
npm run build
Preview the built app:
bun run preview
# or
npm run preview
The project includes both unit/integration tests and end-to-end (E2E) tests.
Test files are located in the tests/ directory.
E2E tests are located in the e2e/ directory.
Before running E2E tests for the first time, install Playwright browsers and dependencies:
bun run playwright:install
bun run playwright:install-deps
> [!NOTE] > All scripts can be run with bun run <script> or npm run <script>. > For building, bun bake is a shortcut for bun run build.
First-time setup:
# Install dependencies
bun install
# Install Playwright browsers (required for E2E tests)
bun run playwright:install
# If you encounter issues, also install system dependencies
bun run playwright:install-deps
Development workflow:
# Run tests during development
bun run check:watch # Unit tests in watch mode
bun run check:e2e:headed # E2E tests with browser visible
# Before committing
bun run test:all # Full test suite with coverage
tests/ # Unit and integration tests (Vitest)
├── svg-editor-core.test.ts # Core class functionality
├── svg-drag-resize.test.ts # Drag-resize functionality and calculations
├── svg-transforms.test.ts # Transform operations and SVG parsing
├── svg-error-handling.test.ts # Error scenarios and edge cases
├── svg-accessibility.test.ts # Accessibility features and integration
├── svg-upload.test.ts # File upload functionality
├── svg-download.test.ts # File download functionality
├── svg-optimization.test.ts # SVG optimization features
├── svg-resolution-change.test.ts # Resolution modal and resizing
├── svg-fallback-sizing.test.ts # SVG sizing logic
├── svg-linting.test.ts # SVG/XML linting functionality
├── svg-drag-drop-clear.test.ts # Drag & drop and clear functionality
├── pinch-zoom.test.ts # Pinch zoom calculations
└── tokyo-night-theme-integration.test.ts # Tokyo Night theme integration
e2e/ # End-to-end tests (Playwright)
├── svg-editor.spec.ts # Core editor functionality
├── svg-drag-resize.spec.ts # Drag-resize E2E testing and accessibility
├── svg-upload.spec.ts # Upload workflows
├── svg-accessibility.spec.ts # Accessibility testing
├── svg-error-handling.spec.ts # Error scenarios
├── svg-linting.spec.ts # Linting integration tests
├── svg-drag-drop-clear.spec.ts # Drag & drop and clear functionality
└── svg-mobile-performance.spec.ts # Mobile, performance, compatibility
> Note: Keep test files in their respective directories to avoid runner conflicts. Vitest excludes the e2e/ directory, and Playwright only looks in the e2e/ directory.
For comprehensive testing instructions, setup details, and CI configuration, see TESTING_GUIDE.md.
src/
├── app.ts # Main TypeScript application
├── theme.css # CSS styles with Tailwind
├── index.html # Main HTML file
└── ico/ # Icon assets
tests/ # Unit and integration tests (Vitest)
├── svg-editor-core.test.ts # Core class functionality
├── svg-drag-resize.test.ts # Drag-resize functionality and calculations
├── svg-transforms.test.ts # Transform operations and SVG parsing
├── svg-error-handling.test.ts # Error scenarios and edge cases
├── svg-accessibility.test.ts # Accessibility features and integration
├── svg-upload.test.ts # File upload functionality
├── svg-download.test.ts # File download functionality
├── svg-optimization.test.ts # SVG optimization features
├── svg-resolution-change.test.ts # Resolution modal and resizing
├── svg-fallback-sizing.test.ts # SVG sizing logic
├── svg-linting.test.ts # SVG/XML linting functionality
├── svg-drag-drop-clear.test.ts # Drag & drop and clear functionality
├── pinch-zoom.test.ts # Pinch zoom calculations
└── tokyo-night-theme-integration.test.ts # Tokyo Night theme integration
e2e/ # End-to-end tests (Playwright)
├── svg-editor.spec.ts # Core editor functionality
├── svg-drag-resize.spec.ts # Drag-resize E2E testing and accessibility
├── svg-upload.spec.ts # Upload workflows
├── svg-accessibility.spec.ts # Accessibility testing
├── svg-error-handling.spec.ts # Error scenarios
├── svg-linting.spec.ts # Linting integration tests
├── svg-drag-drop-clear.spec.ts # Drag & drop and clear functionality
└── svg-mobile-performance.spec.ts # Mobile, performance, compatibility
dist/ # Built assets (generated)
├── theme.css # Compiled CSS
├── app.js # Bundled JavaScript
└── index.html # HTML file
The application is built with modern web technologies:
The project uses modern development practices:
When adding tests, place them in the appropriate directory:
This separation prevents test runner conflicts and ensures tests run with the correct environment.
Modern browsers supporting ES2022+ features:
CC0 1.0 Universal - Public Domain