Placeholder 2.0 - Premium Drag Experience
What's Included
- Source code package (project files)
- Production-ready dist build
- GrapesJS Studio compatible
- Commercial license
- Future updates included
GrapesJS Compatible
Tested with GrapesJS 0.21.x, 0.22.x, 0.20.x
Source Code Included
Full source + production-ready dist build
Studio Ready
Fully compatible with GrapesJS Studio
Commercial License
Use in client projects without restrictions
Stop fighting GrapesJS's default drag-and-drop. Placeholder 2.0 replaces the standard grey rectangle with a live, full-size preview of the block being dragged — complete with smooth animations, drop-zone highlighting, and full control over the visual feel.
Your users see exactly what they're placing, exactly where it lands. No more guesswork.
What's new in v1.5.0
A full rebuild from the ground up — same behavior you loved, modern toolchain underneath:
- TypeScript-first — full source rewrite with bundled
.d.tsdeclarations for instant autocomplete - GrapesJS 0.21 + 0.22 support — works with current releases out of the box
- ~8 KB gzipped — Vite-powered build, half the size of the old Webpack bundle
- 10 animation presets + custom CSS animations
- Custom placeholder mode — replace the live preview with your own HTML/CSS
- Configurable drop-zone color (
dropZoneColor) — match your brand - Fine-tuned timings —
flipDurationMs,flipThresholdPx,escapeDispatchDelayMsare now exposed - Clean teardown — idempotent
destroy()method; no leaked event listeners oneditor.destroy() - Option validation — invalid values fall back to defaults with a clear
console.warninstead of silently breaking - 76 unit + integration tests (Vitest) — battle-tested before every release
- Firefox compatibility fixes — drag-outside-canvas behavior is now reliable across all major browsers
- GrapesJS Studio SDK compatible — works inside the Studio editor
Features
Live content preview while dragging
Forget the default placeholder. Your block is rendered at full size with all its styles applied as you move it — the user sees the actual result, in real time.
10 built-in animation presets
Pick the feel that matches your editor:
| Preset | Effect |
|---|---|
animation1 | Slidein — scale + fade + max-height |
animation2 | Drop-in — rotate + translate |
animation3 | Horizontal slide |
animation4 | Wipe enter — scale wipe |
animation5 | Pulse — scale pulse |
animation6 | Fade in up |
animation7 | Zoom-in soft (cubic-bezier overshoot) |
animation8 | Flip-in — 3D X-axis flip |
animation9 | Rotate-in |
animation10 | Elastic drop — bouncing landing |
Custom animations
Drop in your own @keyframes + .animation CSS — total creative control:
{ customAnimation: ` @keyframes my-anim { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } } .animation { animation: my-anim 300ms ease-out both; } ` } Custom placeholder block
Want a thin drop indicator instead of a live preview? Swap it out:
{ dragPlace: { default: 0, html: { block: 'div', content: '' }, css: 'background: #5C6AC4; height: 4px; width: 100%;', } } Drop-zone highlighting
A configurable color outline marks the active drop target — no more "where is this going to land?"
Per-component opt-out
Some component types (e.g. text) work better with the default placeholder. List them in dragDefault and the plugin steps aside automatically.
Quick start
npm install grapesjs-plugin-placeholder2 import grapesjs from 'grapesjs'; import placeholder from 'grapesjs-plugin-placeholder2'; grapesjs.init({ container: '#gjs', plugins: [placeholder], pluginsOpts: { [placeholder]: { animation: 'animation1', dropZoneColor: '#5C6AC4', dragDefault: ['text'], } } }); Also ships as a UMD bundle for plain <script> tag usage.
Use cases
- SaaS page builders — give your users a premium drag-and-drop feel
- CMS editors — make content blocks feel tangible
- Email builders — visualize block placement before drop
- Landing-page tools — polish the editing UX
- GrapesJS Studio projects — fully Studio SDK compatible
Technical details
- GrapesJS:
^0.21.0 || ^0.22.0 - Bundles: ESM + UMD with rolled-up TypeScript declarations
- Size: ~8 KB gzipped
- Node: ≥18 (for development)
- Tested: 72 Vitest tests + Playwright E2E suite
Why upgrade from the old version?
If you're using the original Placeholder plugin:
- The old plugin was Webpack 3 + Babel 6 — no longer compatible with modern toolchains
- No TypeScript, no types, no Studio SDK support
- Hardcoded colors, hardcoded timings, no
destroy()method - Event listeners leaked across editor instances
v1.5.0 fixes all of this without changing the API surface you know.
Ratings:
No reviews yet. Be the first to share your experience.
Question and Answers (0)
No question found
Common problems this plugin can help fix
Real community questions on the same topic — see how others worked around them.
- #840💬 3 answers
When dragging an element, misleading drop placeholder
- #5362💬 4 answers
Draggable/droppable property functions not called while dragging
- #1161💬 2 answers
Do I need to include dropzone css to show the dragging hover
- #4991💬 1 answers
Wrong Placeholder marker when dragging a display:grid element
