Interface: Toolbar
Controller returned by createToolbar().
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
items | readonly | readonly ToolbarItem[] | The items passed in options. |
Methods
getCustomItemProps()
getCustomItemProps(id, props): ElementProps;Make an element that is not one of items (for example the link popover's trigger) part of the toolbar's keyboard navigation. Its own props are kept; the toolbar adds the roving tabindex and focus tracking.
Parameters
| Parameter | Type |
|---|---|
id | string |
props | ElementProps |
Returns
getItemProps()
getItemProps(id): ElementProps;Props for an item's button: aria-label, title with the shortcut, aria-keyshortcuts, aria-pressed and data-state for toggles, disabled, roving tabindex. Click runs the command without taking focus from the editor. Throws for an unknown id.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
getRootProps()
getRootProps(): ElementProps;Props for the toolbar element: role, aria-label, aria-orientation. Arrow keys, Home and End move focus between enabled items.
Returns
getState()
getState(): ToolbarState;The current state; the same object until something changes.
Returns
subscribe()
subscribe(listener): () => void;Listen for state changes. The toolbar follows the editor only while someone listens.
Parameters
| Parameter | Type |
|---|---|
listener | () => void |
Returns
() => void