Interface: UseToolbarResult
Returned by useToolbar().
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
items | readonly | readonly ToolbarItem[] | The items passed in options. |
state | readonly | ToolbarState | The toolbar state; the component re-renders when it changes. |
Methods
getCustomItemProps()
ts
getCustomItemProps(id, props): ReactProps;Add your own element (e.g. the link trigger) to the toolbar's arrow-key navigation.
Parameters
| Parameter | Type |
|---|---|
id | string |
props | ReactProps |
Returns
getItemProps()
ts
getItemProps(id): ReactProps;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()
ts
getRootProps(): ReactProps;Props for the toolbar element: role, aria-label, aria-orientation. Arrow keys, Home and End move focus between enabled items.