Toolbar reference
Every PPTX editor toolbar group, slot, named part, group option, keyboard rule, and command state rule.
This page lists the toolbar identifiers and rules. For the tasks, see Toolbar.
Registered groups and slots
These identifiers come from the shared chrome registry (CHROME_GROUPS). A registered operation can stay disabled with the engine's refusal reason. The preset toolbar never shows the slots marked with an asterisk (*); see Place the shape format controls. The contextual groups (view, file, edit, slide, and section) belong to the menus, the slide rail, and the slide sorter. A named part or Toolbar.Slot can still place one of their slots.
The toolbar shows only the groups that act on the selection:
| Selection | Groups on the toolbar |
|---|---|
| Nothing, or slides in the slide rail | history, insert, find |
| Text with the caret or a text range in it | history, font, text, paragraph, list, insert, format |
| One or more shapes | history, font, text, paragraph, insert, shape, format, arrange, more |
| Pictures only | history, insert, image, arrange, more |
| One chart | history, insert, chart, arrange, more |
| One diagram, or the caret in a diagram shape | history, insert, diagram, arrange, more |
| Text in a table cell, or a range of cells | history, font, text, paragraph, list, insert, format, table |
| A table, selected as an object | history, font, text, paragraph, insert, format, arrange, more, table |
| The speaker notes field, while it has focus | history, text.bold, text.italic, text.underline, and text.strike (they format the notes), and find |
Hiding a group never turns off its commands: menus, shortcuts, and the ribbon still run them. Insert > Table in the menu bar places table.insert.
- A
Toolbar.Slotor named part for a slot of these groups changes that control. It shows while its group shows. - A
Toolbar.Slotfor a slot that no context shows, such as a slot marked with an asterisk, goes after the groups and shows for every selection. - An application group with
afterfollows its anchor. When the selection does not show the anchor, the group follows the nearest shown group before the anchor, in this order:history,font,text,script,paragraph,list,insert,image,chart,diagram,shape,format,arrange,more,slide,find,table. Withcontextual={false}, it follows the order of that bar: its groups, thenimage,chart,diagram, andtable. - Set
contextual={false}to show every group for every selection. The controls that cannot run are disabled with the engine's reason, and theimage,chart,diagram, andtablegroups join after the other groups. The slots marked with an asterisk stay off the bar in both modes. - A
preset={false}bar shows the slots you place for every selection.
| Group identifier | Slot identifiers |
|---|---|
history | history.undo, history.redo |
font | font.family, font.size |
text | text.bold, text.italic, text.underline, text.strike, text.characterSpacing*, text.changeCase*, text.color, text.highlight, text.link*, text.dialog (contextual) |
script | script.super*, script.sub* |
paragraph | paragraph.align, paragraph.textDirection*, paragraph.valign, paragraph.autofit*, paragraph.columns*, paragraph.dialog (contextual) |
list | list.bullet, list.bulletStyle, list.numbered, list.numberStyle, list.outdent, list.indent, list.lineSpacing |
insert | insert.textBox, insert.line, insert.shape, insert.image, insert.chart, insert.equation* |
shape | shape.styles*, shape.fill, shape.lineColor, shape.lineWidth, shape.lineStart, shape.lineEnd, shape.lineDash, shape.effects*, shape.textEffects*, shape.properties* |
format | format.painter, format.clear |
arrange | arrange.order, arrange.align, arrange.rotate*, arrange.group*, arrange.ungroup*, arrange.selectionPane* |
more | more.duplicate, more.delete |
find | find.find, find.replace* |
view (contextual) | view.presentationView, view.smartGuides, view.playFromStart, view.playFromCurrent |
file (contextual) | file.pageSetup |
edit (contextual) | edit.cut, edit.copy, edit.paste, edit.selectAll |
slide (contextual) | slide.background, slide.add, slide.layout, slide.reset, slide.hide |
section (contextual) | section.add, section.rename, section.remove, section.removeAll, section.collapseAll, section.expandAll |
table (contextual, shown in a table) | table.insert, table.headerRow, table.totalRow, table.bandedRows, table.firstColumn, table.lastColumn, table.bandedColumns, table.style, table.cellFill, table.borderTarget, table.borderColor, table.borderStyle, table.borderWidth, table.select, table.delete, table.insertRowAbove, table.insertRowBelow, table.insertColumnLeft, table.insertColumnRight, table.mergeCells, table.splitCell, table.distributeRows, table.distributeColumns, table.cellMargins |
chart (contextual, shown for one chart) | chart.editData (opens the Chart tab of the side panel) |
diagram (contextual, shown for one diagram) | diagram.addAfter, diagram.addBefore, diagram.addBelow, diagram.delete |
review (contextual) | review.addComment (opens a new comment draft in the comments pane of @pptx-editor.dev/pro) |
image (contextual) | image.corrections, image.color*, image.transparency*, image.change, image.reset*, image.styles, image.altText, image.crop, image.cropToShape*, image.cropFit*, image.properties |
Named parts
| Part | Slot |
|---|---|
Toolbar.Undo | history.undo |
Toolbar.Redo | history.redo |
Toolbar.FontFamily | font.family |
Toolbar.FontSize | font.size |
Toolbar.Bold | text.bold |
Toolbar.Italic | text.italic |
Toolbar.Underline | text.underline |
Toolbar.Strike | text.strike |
Toolbar.CharacterSpacing | text.characterSpacing |
Toolbar.ChangeCase | text.changeCase |
Toolbar.FontColor | text.color |
Toolbar.Highlight | text.highlight |
Toolbar.Link | text.link |
Toolbar.ClearFormatting | format.clear |
Toolbar.Font | text.dialog |
Toolbar.Superscript | script.super |
Toolbar.Subscript | script.sub |
Toolbar.Alignment | paragraph.align |
Toolbar.TextDirection | paragraph.textDirection |
Toolbar.VerticalAlignment | paragraph.valign |
Toolbar.BulletList | list.bullet |
Toolbar.BulletStyle | list.bulletStyle |
Toolbar.NumberedList | list.numbered |
Toolbar.NumberStyle | list.numberStyle |
Toolbar.Outdent | list.outdent |
Toolbar.Indent | list.indent |
Toolbar.LineSpacing | list.lineSpacing |
Toolbar.Columns | paragraph.columns |
Toolbar.Paragraph | paragraph.dialog |
Toolbar.TextBox | insert.textBox |
Toolbar.Line | insert.line |
Toolbar.Shapes | insert.shape |
Toolbar.ImageInsert | insert.image |
Toolbar.ChartInsert | insert.chart |
Toolbar.Equation | insert.equation |
Toolbar.ShapeFill | shape.fill |
Toolbar.LineColor | shape.lineColor |
Toolbar.LineWidth | shape.lineWidth |
Toolbar.LineStart | shape.lineStart |
Toolbar.LineEnd | shape.lineEnd |
Toolbar.LineDash | shape.lineDash |
Toolbar.ShapeStyles | shape.styles |
Toolbar.ShapeEffects | shape.effects |
Toolbar.TextEffects | shape.textEffects |
Toolbar.FormatShape | shape.properties |
Toolbar.FormatPainter | format.painter |
Toolbar.Order | arrange.order |
Toolbar.AlignObjects | arrange.align |
Toolbar.GroupObjects | arrange.group |
Toolbar.UngroupObjects | arrange.ungroup |
Toolbar.Rotate | arrange.rotate |
Toolbar.SelectionPane | arrange.selectionPane |
Toolbar.Duplicate | more.duplicate |
Toolbar.Delete | more.delete |
Toolbar.Find | find.find |
Toolbar.Replace | find.replace |
Toolbar.SmartGuides | view.smartGuides |
Toolbar.PlayFromStart | view.playFromStart |
Toolbar.PlayFromCurrent | view.playFromCurrent |
Toolbar.PageSetup | file.pageSetup |
Toolbar.Cut | edit.cut |
Toolbar.Copy | edit.copy |
Toolbar.Paste | edit.paste |
Toolbar.SelectAll | edit.selectAll |
Toolbar.FormatBackground | slide.background |
Toolbar.NewSlide | slide.add |
Toolbar.SlideLayout | slide.layout |
Toolbar.ResetSlide | slide.reset |
Toolbar.HideSlide | slide.hide |
Toolbar.PresentationView | view.presentationView |
Toolbar.AddSection | section.add |
Toolbar.RenameSection | section.rename |
Toolbar.RemoveSection | section.remove |
Toolbar.RemoveAllSections | section.removeAll |
Toolbar.CollapseAllSections | section.collapseAll |
Toolbar.ExpandAllSections | section.expandAll |
Toolbar.TableInsert | table.insert |
Toolbar.TableStyle | table.style |
Toolbar.TableHeaderRow | table.headerRow |
Toolbar.TableTotalRow | table.totalRow |
Toolbar.TableBandedRows | table.bandedRows |
Toolbar.TableFirstColumn | table.firstColumn |
Toolbar.TableLastColumn | table.lastColumn |
Toolbar.TableBandedColumns | table.bandedColumns |
Toolbar.TableCellFill | table.cellFill |
Toolbar.TableBorderTarget | table.borderTarget |
Toolbar.TableBorderColor | table.borderColor |
Toolbar.TableBorderStyle | table.borderStyle |
Toolbar.TableBorderWidth | table.borderWidth |
Toolbar.TableSelect | table.select |
Toolbar.TableDelete | table.delete |
Toolbar.TableInsertRowAbove | table.insertRowAbove |
Toolbar.TableInsertRowBelow | table.insertRowBelow |
Toolbar.TableInsertColumnLeft | table.insertColumnLeft |
Toolbar.TableInsertColumnRight | table.insertColumnRight |
Toolbar.TableMergeCells | table.mergeCells |
Toolbar.TableSplitCell | table.splitCell |
Toolbar.TableDistributeRows | table.distributeRows |
Toolbar.TableDistributeColumns | table.distributeColumns |
Toolbar.TableCellMargins | table.cellMargins |
Toolbar.ImageCorrections | image.corrections |
Toolbar.ImageColor | image.color |
Toolbar.ImageTransparency | image.transparency |
Toolbar.ImageChange | image.change |
Toolbar.ImageReset | image.reset |
Toolbar.ImageStyles | image.styles |
Toolbar.ImageAltText | image.altText |
Toolbar.ImageCrop | image.crop |
Toolbar.ImageCropToShape | image.cropToShape |
Toolbar.ImageCropFit | image.cropFit |
Toolbar.ImageProperties | image.properties |
Toolbar.ChartEditData | chart.editData |
Toolbar.DiagramAddAfter | diagram.addAfter |
Toolbar.DiagramAddBefore | diagram.addBefore |
Toolbar.DiagramAddBelow | diagram.addBelow |
Toolbar.DiagramDelete | diagram.delete |
Toolbar.AddComment | review.addComment |
Pickers
Pickers take className and hidden: Toolbar.FontFamily, Toolbar.FontSize, Toolbar.CharacterSpacing, Toolbar.ChangeCase, Toolbar.Alignment, Toolbar.TextDirection, Toolbar.VerticalAlignment, Toolbar.BulletStyle, Toolbar.NumberStyle, Toolbar.LineSpacing, Toolbar.Columns, Toolbar.Line, Toolbar.Shapes, Toolbar.LineWidth, Toolbar.LineStart, Toolbar.LineEnd, Toolbar.LineDash, Toolbar.ShapeStyles, Toolbar.ShapeEffects, Toolbar.TextEffects, Toolbar.Order, Toolbar.AlignObjects, and Toolbar.Rotate. The color split controls (Toolbar.FontColor, Toolbar.Highlight, Toolbar.ShapeFill, Toolbar.LineColor) also take icon, the glyph over the color bar. A picker has no single element, so asChild on a picker slot prints a development warning and does nothing.
Parts the bar does not show
A named part for a slot that the toolbar does not show, such as Toolbar.SmartGuides, Toolbar.Cut, Toolbar.Font, or Toolbar.Paragraph, goes after the groups. text.dialog and paragraph.dialog are contextual: the bar has no dialog launcher, so it does not show them. Format > Font… and Character Spacing > More Spacing… open the Font dialog. Format > Paragraph… and Line Spacing Options… open the Paragraph dialog.
In a preset bar, an image part replaces that control in the picture group. That group shows only while every selected element is a picture. In a preset={false} bar, the part stays in place, disabled with the reason, such as "Select a picture", until a picture is selected.
Toolbar.Separator draws a rule between controls in a preset={false} bar.
Section parts
Toolbar.AddSection and Toolbar.RenameSection open the section name field in a mounted slide rail (PptxEditor.SlideRail) or slide sorter (PptxEditor.SlideSorter). Without one, Toolbar.RenameSection is off with the reason disabled.noSectionPane, and Toolbar.AddSection adds the section without the name field. To start a rename from your own chrome, call requestSectionRename(editor, sectionId) from @pptx-editor.dev/react or @pptx-editor.dev/vue. It also needs a mounted rail or sorter.
Group options
| Prop | Use |
|---|---|
id | A built-in group identifier or your application group identifier. TypeScript suggests the built-in identifiers through the ChromeGroupId type. |
label | Accessible name, and the heading of the group's section in the More menu. Takes priority over labelKey. |
labelKey | Catalog key for your group's accessible name. |
after | Places your group after another group. Applies to application groups. When the selection does not show that group, your group follows the nearest shown group before it. |
priority | Lower numbers move to the More menu first. See Overflow order. |
pinned | Keeps your group on the bar at every width. |
hidden | Removes the group from the bar and the More menu. |
overflowContent | A function that returns the group's content in the More menu (() => ReactNode). |
className | Styles the group wrapper. |
Overflow order
When the toolbar runs out of width, a whole group moves into the More menu. A built-in group's priority is its place in TOOLBAR_COLLAPSE_ORDER, in steps of 10: view is 10 and history is 180. The view, file, Find, clipboard, and slide groups move first. The arrange, format, shape, and script groups move next. The insert group (text box, line, shape, picture) moves after them, then the list and paragraph groups. The table group, which shows only while the selection is in a table, moves after those. The font, text, and history groups stay longest, on the toolbar and on every ribbon tab.
The contextual image group's priority is 190, so it stays longest, because the selection asked for it. A group without a priority moves first.
Action options
Toolbar.Action gives your operation the toolbar's button styling, state attributes, keyboard behavior, and selection protection.
| Prop | Use |
|---|---|
label | Required accessible name and tooltip, from your own catalog. |
icon, children | Visible content. |
onSelect | Runs your action. In Vue, listen to select. |
active | Sets aria-pressed and data-active. |
disabled, disabledReason | Disables the action and explains why. The button stays focusable. |
asChild | Applies the behavior to one child element. |
className | Styles the action. |
Keyboard and focus behavior
The toolbar is an ARIA toolbar with one Tab stop. The control that last had focus keeps the Tab stop. ArrowLeft, ArrowRight, Home, and End move between the controls. A right-to-left interface swaps the arrows. The Font size field keeps Home and End, and keeps each arrow until the caret reaches that end of its text.
A disabled control carries aria-disabled="true" instead of the native disabled attribute. It stays in the arrow order, runs nothing, and gives its reason to assistive technology. Your own buttons, inputs, and links inside the toolbar join the arrow order. Use aria-disabled on them too: a native disabled control leaves the order.
Command state from useEditorCommand
useEditorCommand(slotId) returns isEnabled, isActive, disabledReason, value, and execute. A slot that opens a surface (a dialog, find, or the slide show) runs through PptxEditor.Root, as a menu row does. Outside a root, that slot is disabled with the disabled.noRoot reason. When the popups entry of its surface is false, the slot is disabled with the reason that the surface is turned off. find.find and find.replace are also disabled with find.noBar while no PptxEditor.FindBar is mounted. In the slide sorter, they are disabled with disabled.findSorter, because the slide sorter shows no slide canvas. In the slide master view, they are disabled with disabled.slideMaster, because the view shows layouts, not slides.
disabledReason is a catalog key, such as disabled.noSelection, or the engine's own text. Translate it before you show it with translateKeyOrText(t, reason) from @pptx-editor.dev/core/editor, with t from useTranslation(). See Build a control from a command. The packaged controls translate it for you.
text.link is the exception: it stays enabled in both cases, because hiding the popup never turns off links. useEditorCommand('text.link').execute(url) always sets a link, and execute(null) removes it. The engine can still refuse the link: with only a caret outside a link (disabled.selectText), or for an unsafe address (errors.unsafeLink). execute() with no value opens the link popup, and prints a development warning when no popup can open.
In Vue, useEditorCommand follows the same rules through PptxEditorRoot. It starts the slide show, and opens the find bar (disabled with find.noBar while no PptxEditorFindBar is mounted). It also opens the link popup that the root hosts.
Theme fonts
To apply a theme font, pass its reference: execute('+mj-lt') for the headings font, and execute('+mn-lt') for the body font. The text then keeps the theme reference and follows a theme change (ECMA-376 Part 1, 20.1.4.1.17 latin). To mark the theme row as current, read snapshot().format?.fontFamilyTheme (a SelectionFormat field). It is major for the headings font, minor for the body font, and absent for a literal family. value is the theme's family name in both cases.
React and Vue reference
The Vue toolbar draws the same controls as the React toolbar, with the same markup, classes, and ARIA. This includes the pickers, the font size stepper, the value menus, the color splits, the galleries, and the table grid. It also includes the link control, Find and Replace, the slide show buttons, and the dialog and file picker buttons. Groups that do not fit the width move into the More menu. overflow, priority, pinned, and overflowContent work as in React.
Vue provides the same customization levels:
className(or a hostclass) onPptxEditorToolbar.Slotor on a named part goes on the control. This applies to every Vue part whose React twin takesclassName.- The
iconprop (or theiconslot) replaces the registry icon of a button or of the main half of a color split. as-childrenders the control as the one element in the default slot. It gets the label, the state attributes, and the click handler. An element that is not a button also getsrole="button", a tab stop, and Enter and Space.- Without
as-child, default slot content ofPptxEditorToolbar.Slotreplaces the control. The default slot of a named button part (PptxEditorToolbar.Bold) is its icon. PptxEditorToolbar.Action,PptxEditorToolbar.Slot, and the named button parts takeas-child.- A picker refuses
iconandas-childwith a development warning, as in React. - Any other attribute on a slot part, such as
style,id, ordata-*, never reaches the control and prints a development warning. Aclassoriconon a slot with its own content also warns, because no control renders to take it.
LayoutGallery takes the same props in Vue, and emits change with the picked layout's id. className (or a host class) goes on the gallery. ShapeStyleGallery and ShapeGrid take onPick as a prop, as in React. MenuTableGrid takes onPick and onInserted as props, as in React, because they change what a pick does.
See also
- Toolbar
CHROME_GROUPSinchrome-controls.ts, for every control's label, icon, and state@pptx-editor.dev/reactAPI report, for the part types