Skip to main content
v7

DrawingEditor

Draw, transform and persist a controlled layered scene; export real flattened PNG bytes.

Package@g4rcez/componentsSectionForm Controls

Examples

Layered drawing

Add text or shapes, draw with pencil, select and transform layers, then save/resume the JSON scene. This example saves in this mounted page only—not on a server.

Loading drawing images…

Select layers in the list or on canvas. Drag corner handles to scale, the round top handle to rotate; Shift snaps rotation. Arrow keys move (Shift: 10 px). Delete removes unlocked layers. ⌘/Ctrl Z undoes, Shift Z redoes. Escape cancels a gesture or selection. All transforms are also available as labeled fields.

Layers · 0/100

No layers. Add paint, text, a shape or an image to begin.

    800 × 500 · 0 selected.

    Integration and accessibility

    Persist the scene with an optimistic revision and source hash. Upload PNG separately, await success, then attach its durable reference to your record. The imperative ref also exposes exportPng and focus. Keyboard layer controls, transform fields and rectangular selection fields accompany pointer gestures. Read-only prevents mutation but retains export.

    Load drawing-editor.css and its style-manifest dependency closure. The source-image asset is resolved by the host rather than copied into every scene/history snapshot. See the canonical drawing-editor reference for limits and all public types.

    When to use DrawingEditor

    Use when

    You need the documented DrawingEditor interaction or presentation in a product workflow.

    Avoid when

    A native HTML element already provides the DrawingEditor behavior you need.

    Accessibility

    Keep the DrawingEditor labeled and use its documented keyboard interaction. The component preserves visible focus and communicates state without relying on color alone.