Skip to content

Interface: UseToolbarResult ​

Returned by useToolbar().

Properties ​

PropertyModifierTypeDescription
itemsreadonlyreadonly ToolbarItem[]The items passed in options.
statereadonlyReadonly<ShallowRef<ToolbarState>>The controller state as a shallow ref; updated on the client while the scope is alive.

Methods ​

getCustomItemProps() ​

ts
getCustomItemProps(id, props): VueProps;

Add your own element (e.g. the link trigger) to the toolbar's arrow-key navigation.

Parameters ​

ParameterType
idstring
propsVueProps

Returns ​

VueProps


getItemProps() ​

ts
getItemProps(id): VueProps;

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 ​

ParameterType
idstring

Returns ​

VueProps


getRootProps() ​

ts
getRootProps(): VueProps;

Props for the toolbar element: role, aria-label, aria-orientation. Arrow keys, Home and End move focus between enabled items.

Returns ​

VueProps