components / editor-toolbar

editor-toolbar.

the bar above a markdown editor: edit/preview/split toggle, format buttons, and an action cluster. with enableDrawing it owns the floating numbered drawing windows.

getting started

guides / getting-started

save: cmd/ctrl+s
mode: split · drawings saved: 0

click “new drawing” to open windows — open several; each is numbered and can be dragged and brought to front.

installation
bunx @justin06lee/chrome@latest add editor-toolbar
props
nametypedefaultdescription
titleReactNode-
subtitleReactNode-
modestring-current view mode; pass onModeChange to render the toggle.
onModeChange(mode: string) => void-
modesstring[]['edit','preview','split']
actionsReactNode-right-hand button cluster.
formatActionsEditorFormatAction[]MARKDOWN_FORMAT_ACTIONS
onFormat(action: EditorFormatAction) => void-fired on a format button; omit to hide them.
statusReactNode-right-aligned hint in the format row.
enableDrawingbooleanfalseshow 'new drawing' and own the numbered drawing windows.
onSaveDrawing(result: { dataUrl: string; darkDataUrl?: string }) => void | Promise<void>-fired when a drawing window saves; it then closes.
drawingSubtitlestring-subtitle under each window's 'drawing #N' title.
drawingDarkMappingboolean-use the drawing window's light-to-dark mapping mode.
classNamestring-