Reuse the same icon set in built-in and custom buttons
The legacy topic overlaps with custom buttons in the current build: you can override built-in icons with
icons and also feed the same markup into context.ui.icon(...) inside a custom button factory.
HTML output
Ready.
Example configuration - Custom Button Icons
function CalloutButton(context) {
const ui = context.ui;
return ui.button({
contents: ui.icon(iconSet.callout),
tooltip: 'Insert a callout block',
click() {
context.invoke('editor.pasteHTML', calloutMarkup);
},
}).render();
}
summernote.create('#custom-icon-button-editor', {
height: 220,
toolbar: [
['style', ['bold']],
['custom', ['callout', 'stamp']],
],
icons: {
bold: iconSet.bold,
},
buttons: {
callout: CalloutButton,
stamp: StampButton,
},
});