Skip to content

Framework Adapters

Official adapters wrap createEditor() for React, Vue, Svelte, Angular, Astro, and Vanilla JS. All adapters share the same core API: mount, getValue / setValue, events, undo/redo, and destroy().

Install

bash
pnpm add velo-circuit
FrameworkImport path
Corevelo-circuit
Vanillavelo-circuit/vanilla
Reactvelo-circuit/react
Vue 3velo-circuit/vue
Sveltevelo-circuit/svelte
Angularvelo-circuit/angular
Astrovelo-circuit/astro

See Package Exports for the full map.

Editor presets

Every adapter accepts preset:

PresetDescription
'extended' (default)Full toolbar, DSL panel, grid view, export, diagnostics
'lite'In-canvas editing only — no global toolbar or side panels
'minimal'Canvas pan/zoom/selection only
ts
import { useCircuitEditor } from 'velo-circuit/react'

useCircuitEditor({ preset: 'lite', initialDsl: 'R0-p(R1,C1)' })

Details: Editor Presets · Plugins API

Building blocks

Compose DSL field, canvas, and catalog independently or synced:

NeedReactVueSvelteAngularAstroVanilla
DSL onlyuseDslCodeMirroruseDslCodeMirroruse:dslCodeMirrormountDslmountAstroDslCodeMirrormountDslCodeMirror
Canvas liteuseCircuitEditoruseCircuitEditoruse:circuitEditormountmountAstroCircuitEditormountCircuitEditor
DSL + lite syncuseCircuitWorkbenchuseCircuitWorkbenchbindCircuitWorkbenchmountWorkbenchmountAstroCircuitWorkbenchmountCircuitWorkbench
Static SVGrenderDslPreviewSvgsamesamesamesamesame
GridcreateCircuitGridsamesamesamesamesame

See React adapter for full composition examples.

DSL theme

The DSL field does not use a fixed palette. Pass themeMode: 'light' | 'dark' synchronized with your app or editor theme. Inside the extended editor, the DSL panel follows theme-changed automatically.

Core usage (any framework)

ts
import { createEditor, resolvePlugins } from 'velo-circuit'

const editor = createEditor({ plugins: resolvePlugins('lite') })
editor.mount(container, { initialDsl: 'R0-p(R1,C1)-Wo2', width: 800, height: 600 })
editor.on('ast-changed', () => console.log(editor.getValue()))

Comparison

NeedUse
Full editor with pan/zoom, editing, validationAdapter, preset: 'extended'
Embed in app with own chromeAdapter, preset: 'lite'
Read-only canvaspreset: 'minimal' or renderDslPreviewSvg()
Data grid with DSL + SVG columnscreateCircuitGrid()
Custom pipelineParser + layout + render from core

Adapter guides