Skip to content

How do I customize icons in menu bar? #1990

Answered by Saul-Mirone
chessurisme asked this question in Q&A
Discussion options

You must be logged in to vote

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:

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 = paragraph…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chessurisme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants