How do I customize icons in menu bar? #1990
Answered
by
Saul-Mirone
chessurisme
asked this question in
Q&A
-
I am trying to customize this part, how? I can't find any of the documentation regarding to this. I explored all of the |
Beta Was this translation helpful? Give feedback.
Answered by
Saul-Mirone
Jun 26, 2025
Replies: 1 comment
-
how do you want to customize it? If you want to replace the whole menu, you can do: const config: CrepeConfig = {
features: {
[Crepe.Feature.BlockEdit]: true,
},
featureConfigs: {
[Crepe.Feature.BlockEdit]: {
buildMenu: (builder) => {
// Custom menu building logic
builder.clear();
const group1 = builder.addGroup('group1', 'group1');
group1.addItem('text', {
label: 'Text',
icon: textIcon,
onRun: (ctx) => {
const commands = ctx.get(commandsCtx)
const paragraph = paragraphSchema.type(ctx)
commands.call(clearTextInCurrentBlockCommand.key)
commands.call(setBlockTypeCommand.key, {
nodeType: paragraph,
})
},
})
},
},
},
} You can learn more from the source code: https://github.com/Milkdown/milkdown/blob/main/packages/crepe/src/feature/block-edit/menu/config.ts#L59-L77 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
chessurisme
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do you want to customize it?
If you want to change the text or icon for one item:
#1953
https://milkdown.dev/docs/api/crepe#blockedit-feature
If you want to replace the whole menu, you can do: