DeckEditor

A full slide deck editor: insert tools, a floating format toolbar, a settings sidebar, a reorderable slide rail, themes, and presenting. You own the deck and its undo history; it can also show what someone else (like an AI) is editing.

Installation

npx dafink-ui add deck-editor

Also installs: Button, Charts, Color-picker, Context-menu, Input, Menu, Meteors, Models, Particles, Popover, Reveal, Select, Slide-canvas, Switch, Table, Text-scramble, Textarea, Toggle-group, Typewriter

Requires: @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities, @tiptap/react, @tiptap/pm, @tiptap/starter-kit, @tiptap/extension-text-align, @tiptap/extension-text-style, jspdf, jszip, pptxgenjs, svg2pdf.js

Demo

Props

NameTypeDefaultDescription
deckDeck—The deck being edited (controlled).
onChange(next: Deck, coalesceKey?: string) => void—Every edit, as the whole next deck. Consecutive changes sharing a coalesceKey (a drag, typing) belong in one undo step.
historyEditHistory—{ undo, redo, canUndo, canRedo }: undo and redo from the toolbar and ⌘Z / ⇧⌘Z. Omit to hide the undo controls.
toolbarEndReactNode—Host actions in the top-right cluster, before Present (e.g. a save status and a file menu). Style buttons with the exported TOOLBAR_BUTTON class to match.
highlightIdsstring[][]Elements someone else is editing right now: each gets a pulsing outline and a tag, and their slides get a dot in the rail.
highlightLabelstring'AI'Text on the highlight tag.
activeSlideIdstring—Controlled active slide, e.g. to follow another editor. Omit to manage it internally.
onActiveSlideChange(slideId: string) => void—Called when the user picks a slide.
statusstring—A host message for the polite status line (e.g. export progress).
onAsk(context: DeckAskContext) => void—Adds an "Ask AI" button beside the floating format toolbar. Called with the selected element (slide number, element id, label, type, and its text), or just the text highlighted inside a text box.
classNamestring''Extra classes on the root. It fills its container, so give the container (or this) a height.

Accessibility

The editor is a named role="region". Every element on the slide is a focusable button: focusing one selects it, and its floating format toolbar is a role="toolbar" reached with Alt+F10. It holds only the quick controls plus a More options button that opens the settings panel; while the panel is open the bar is hidden and the panel follows the selected element instead. When the host passes onAsk, the bar also carries an Ask AI (lasso) button, which stays reachable on its own while the panel hides the bar. The slide rail is one Tab stop with roving tabindex, and each thumbnail has a context menu (Shift+F10 or the Menu key). Moves, resizes, and edits are announced through a polite status line, as is the progress of a download from the toolbar's Download menu (a standard menu button: Enter or Space opens it, arrow keys move, Escape closes). Settings are a non-modal region that opens as a column beside the slide when the editor is wide, or slides over its right edge when it's narrow (the editor's own width, not the window's). It doesn't trap focus, and it is inert while closed. Elements someone else is editing get an outline, a tag, and "being edited" in their slide thumbnail's name, so the change isn't signalled by color or motion alone.

KeyFunction
cmd+zUndo (when the host passes history).
shift+cmd+zRedo.
cmd+dDuplicates the selected element.
arrow keysMoves the selected element; with Shift, in bigger steps.
enterStarts editing the selected text box or table.
escapeStops editing, or cancels a drawing tool.
deleteDeletes the selected element.
alt+f10Moves focus into the selected element’s format toolbar.
alt+arrow keysIn the slide rail: moves the focused slide earlier or later.
shift+f10In the slide rail: opens the slide’s actions menu.