Skip to content

Function: useMenu() ​

ts
function useMenu(editor, options): UseMenuResult;

Menu button with one checked choice (e.g. the block type picker). Options are read once.

Parameters ​

ParameterType
editorEditor
optionsMenuOptions

Returns ​

UseMenuResult

Example ​

ts
const blockType = useMenu(editor, { items: basicBlockTypeItems(), label: 'Text style' })