@rifrocket/fdt-plugin-snapping
v3.0.4
Published
A bare on/off toggle for smart-guide snapping, for the FabricJS Design Tool v2.
Downloads
57
Readme
@rifrocket/fdt-plugin-snapping
An on/off toggle panel for smart-guide snapping in Fabric Design Tool.
A panel-slot wrapper plugin: @rifrocket/fabricjs-design-tool already ships SnapEngine (engine.snapping) with no UI attached. install() registers SnappingToggle — a bare on/off switch — into the sidebar-right panel slot.
Features
SnappingToggle— the toggle component, wired toengine.snappingsnappingPlugin— installsSnappingToggleintosidebar-right.uninstall(engine)removes only its own engine's panel registration- ⚠️ This plugin only adds the UI toggle — it does not itself turn snapping on.
SnapEnginebehavior is disabled by default at the engine level. If you want snapping on-by-default with the toggle just letting users turn it off, enable it separately:createEngine(canvasEl, { snapping: { enabled: true } }).
Not bundled into either <DesignEditor> preset — it peer-depends on @rifrocket/fdt-react. Add via plugins.add.
Install
npm install @rifrocket/fdt-plugin-snappingPeer dependencies: fabric, react, react-dom.
Depends on @rifrocket/fabricjs-design-tool and @rifrocket/fdt-react.
Quick start
import { snappingPlugin } from "@rifrocket/fdt-plugin-snapping";
engine.use(snappingPlugin);Documentation
License
MIT © Fabric Design Tool Contributors
