<DocondaEditor> props: its look, language, buttons, menus and AI assistant. Each prop
applies to Word, PowerPoint, Excel and PDF at once; to change only one format, see
one format, differently.
This page covers presets and colours, language, the toolbar and menus, your own buttons, removing parts, the AI
assistant and read-only mode. For every prop, see props.
Choose a preset
preset changes the editor’s look and layout in one go:
theme, toolbar or statusBar replace the preset’s.
Colours and typography
theme takes "light" (the default), "dark" or an object of your own values, merged over the light theme. Each key
becomes a CSS variable on the root element (.ff-root), prefixed so it can’t collide with your page’s: primary is
--doconda-primary, pageShadow is --doconda-page-shadow. So a value can point at a variable of your own:
The page, slides and cells keep the file’s own colours.
With collaboration, the label on other people’s cursors in Word, cells in Excel and shapes in
PowerPoint is drawn on the canvas, not in the DOM, so CSS can’t reach it: style it with the
cursorLabel* keys above.
They accept var() and units like rem, which the editor turns into concrete values when it starts and each time
theme changes; if only your variable changes, pass a new theme for the label to follow. Without these keys the label looks as it
always has. Its background is each person’s colour, which the editor picks per viewer and can’t be set. cursorLabelHidden
keeps the cursor and leaves the user’s name signing comments, so there’s no need for name: "".
Your brand’s colours and fonts
colors: the colours in the colour pickers (text, fill, borders…), with or without#.fonts: the typefaces in the font list. By default it lists the fonts the editor knows; the font the text already uses always appears.
Spell checker
The editor ships no dictionaries, so nothing is underlined until you pass a checker inspell. See
spelling and collaboration.
Language and labels
locale is "es" or "en", or a full tag such as "en-GB" or "es-ES", which also sets how dates and numbers
read. Without it, the editor uses English when the browser’s language is English, and Spanish otherwise. labels overrides any text on top of the chosen language: common buttons go directly inside full, and
the rest as nested keys, such as { full: { file: { save: "Save now" } } }.
Your own language
For any other language, pass your texts inlabels with the same structure. What you don’t translate shows in
Spanish, or in English with locale="en".
In Excel, engineLocale ("es-ES", "en-US"…) sets the decimal and argument separators, the function names (SUMA
or SUM), month names and currency.
Toolbar
By default the full toolbar shows, and what doesn’t fit goes into a More menu.toolbar sets which buttons show
and in what order: a list of IDs, with | between groups.
#Name (_ instead of spaces): the name shows below the group, with
a separator. Inside a group, / starts the next row, id:lg makes a large button with its name (full group height, on
the left) and id:label shows the name next to the icon.
toolbar also takes a list of groups, or a function that receives the default groups and returns yours:
- The defaults are exported as
MAIN_TOOLBAR(Word),MARKDOWN_TOOLBAR,CELL_TOOLBAR,SLIDE_TOOLBARandPDF_TOOLBAR. RIBBONis a tabbed toolbar (Home, Insert, Layout…), used as<DocondaEditor {...RIBBON} />. Its labels are Spanish; change them inmenus.- An ID that doesn’t exist in the open format is ignored.
saveandprintexist even though they aren’t on the default toolbar.
Selection buttons, status bar and right-click menu
The editor has two bars: the toolbar on top and the status bar at the bottom. When the user selects something (a table, an image, a shape, the header…), its buttons show in the same toolbar, after the selection’s name. When they don’t all fit, the general buttons go into More first, so the selection’s buttons stay visible. A group decides when it shows if it starts with@ and a condition:
A group without
@ always shows. With this toolbar, selecting a table hides the text buttons and shows the table’s;
they come back when the table is no longer selected:
#Name after the condition puts the name before the group (_ instead of spaces). The default toolbar already has the
selection groups, each starting with its @ type, so a function receives them and can drop them:
statusBar and menuBar. The right-click menu takes contextMenu, per selection type:
The defaults are exported per format:
Your own menus
menus groups buttons into a dropdown with its own ID, which you then place in toolbar like any other button:
menuBar. It shows above the toolbar,
each menu as text, and takes your class in classNames.menuBar.
simple turns them into a single button
that opens the menu, for all of them (simple) or some (simple={["bullets", "numbering"]}). icons replaces a
button’s icon by its ID, with the path of a 24×24 SVG <path> or any React element.
Your own buttons
Give your button an ID inactions and place it on the toolbar:
An
actions ID that already exists replaces the default button. Through the ref, run(id) presses any button and
actions() returns all of them. For example, run("fitWidth") and run("fitPage") fit the document to the editor in
Word, PowerPoint and PDF.
One format, differently
To change something in only one format, choose the prop yourself from the file you open:Remove parts
To remove the selection buttons, leave out the groups that start with
@:
toolbar={(groups) => groups.filter((g) => !g[0]?.startsWith("@"))}. To remove one option (comments, print, the
File menu…), leave its ID out of toolbar and contextMenu. Its keyboard shortcut still works, and what the file already has still shows: comments in the file stay
visible even without the comment button.
Your classes
classNames puts your class on each part, so you can adjust it with your own CSS:
Everything around the document follows the
theme and takes your class; the page, slides and cells keep the file’s
look.
AI assistant
The AI assistant lets the user ask for changes in plain words (“make it more formal”, “add a row with the March total”, “a conclusions slide”) from the ✨ toolbar button. It reads the whole document and makes the changes in the editor as it answers. When it’s done, the user clicks Keep or Undo once for all of them; undo restores the document as it was before the request.- It’s on by default in Word, Excel and PowerPoint. PDF has no assistant.
- It uses Doconda’s models: no keys or setup on your side. It can also run on your models only, without going through Doconda’s servers.
- It doesn’t show with
readOnly.assistant={false}removes it altogether. - Each plan includes 2,000 edits a month; see the assistant’s edits.
- It can do anything the editor’s menus can (styles, sections, headers and footers, charts, tables, comments…). When something doesn’t apply, it sees why and corrects it, and what it still can’t do it says in its answer.
- Complex edits: with Complex edits on in the dashboard (Editor), a request the assistant can’t make on the spot (redesigning the whole document, rebuilding its structure…) goes to the document agent, which makes it on the document as it was before the request. It takes a few seconds longer, the document is locked while it works, and it is charged as an edit through the API. It is off by default. With collaboration, the others see who is using the assistant and the document is read-only for them until it finishes; one undo by whoever asked brings back the previous document for everyone, and drops what the others edited on the new one.
Where it shows
The ✨ button (ID
assistant) goes at the end of the main toolbar and never hides in the More menu. With
preset="office", it’s a ribbon group after Undo. If you pass your own toolbar, it’s no longer added for you:
place assistant where you want it, or leave it out.
Your own component
render receives the assistant and returns what to draw. With layout: "panel" or "floating", it replaces the
content of the panel or floating box. With layout: "none", it’s drawn as is over the document:
ref. editor.current.assistant is null when the
assistant is removed or the file is a PDF.
With your models only
The assistant can run entirely on your models and your server:transport makes the quick edits and agent the
complex ones. The requests and the document never go through Doconda; only the licence check does.
transport receives body with format ("docx", "xlsx" or "pptx"), instruction,
context (the document with its ids, as agentTools().context() gives it), history, language and agent
(true when it can hand the request to agent). Your server answers with one JSON object per line:
Complex edits.
agent receives the file as it was before the request, in the format it’s open in (format: "docx", "xlsx", "pptx", or "md", "txt" and "csv"; Doconda’s agent only takes the first three), with bytes, filename,
instruction and signal (aborted when the user stops the request), and returns the edited file in the same
format. While it works the document is read-only, also for collaborators; then the editor replaces it as one undo step,
and Keep and Undo work as usual. If it throws, the panel shows the error’s message.
Your own agent
If you already have your own agent (your model, your prompt, your harness), you don’t need Doconda’s assistant to let it edit the open document:agentTools() on the ref gives it the same tools the assistant uses. Your agent reads the
document as blocks with ids and edits it with high-level operations (replace a text, rewrite a paragraph, insert a
table…), checked before they apply. Nothing goes through Doconda’s AI, so it isn’t charged as an assistant request.
The changes follow the editor’s mode: in Suggesting mode they become tracked changes the user accepts or
rejects. To make them suggestions signed by your agent, whatever the mode, pass the options:
It’s still one undo step, in collaboration too, and the other collaborators see the suggestions with that author.
When
apply returns (or throws), the author, the tracking mode and the review view are back to what they were; the
call is synchronous, so nothing the user types falls in between.
What can’t be applied as asked is refused, in failed, and not applied any other way:
- Both options need tracked changes, which only Word documents have: in Excel, PowerPoint, Markdown and plain text,
and with an empty
author, nothing is applied and every operation comes back infailed. - With
suggest, the operations that can’t become a tracked change:set_link,delete_column,shade_cells,delete_blockon a table, andrun, whose commands aren’t all tracked. Comments (add_comment) do apply, signed byauthor.
apply.
When your agent runs on your server
The tools need the page where the document is open, so your server sends the agent’s tool calls to the page and waits for the result. Both examples give the model two tools:read_document (context()) and edit_document (apply()).
The operations are the same for every document of a format, so the page sends them once and your server turns them
into the tool’s schema:
execute go to the page: onToolCall runs them there and addToolOutput returns
the result to the model, which goes on in the same request.
Your components inside the document
slots puts pieces of your own interface where the document’s text matches a pattern, without changing the
document: what’s saved keeps the text as it was. Each rule does one of two things:
- A space for your component (
render): the matching text isn’t drawn. In its place there’s a space as big as your component (or thesizeyou ask for, in points), andrenderdraws your component there: a picker, a button, a chip… - Only a look (
style): the matching text shows highlighted, coloured, underlined… and nothing else changes.
- It works in Word, Excel, PowerPoint and PDF.
- For the cursor, a space is a single piece: the arrows skip it, one click selects it whole (it shows a focus ring),
and Backspace deletes it whole. Formatting applied to it (colour, size…) goes to its text and reaches your
component in
styleandcss. - Clicks go to the document, so a click selects the component. A component that needs the mouse (a button, a menu)
takes
interactive: true. - The component moves with the page as the user types, scrolls or zooms, and scales with the zoom.
- In Excel, the formula bar shows your components too, never the pattern.
A match can cross a soft line break (Shift+Enter) and formatting changes inside a paragraph;
text then has \n for each
break, and the space stays on one line. It doesn’t cross paragraphs, tabs or page breaks. In Excel, each run of a cell is matched on its own.
Read-only
Related
Editor plugin
Install, open and save files, and every prop.
Licence and domains
Plans, domains and the assistant’s included edits.