This plugin allows you to generate buttons in the visual editor with various display styles: gradient, shadow, color, fonts, and much more. The plugin also allows you to edit existing buttons on the page.
The plugin adds a "Button generator" button to the editor toolbar. When you click on this button, a dialog box with button settings opens.
You can also edit existing buttons by double-clicking on them in the editor.
Copyconst jodit = Jodit.make('#editor'); // Insert button via API jodit.events.fire('toggleButtonGenerator');
Copyconst jodit = Jodit.make('#editor'); // Create button element const button = jodit.createInside.element('button'); button.innerText = 'My Button'; // Apply styles const styles = { text: 'My Button', bgStart: '#44c767', bgEnd: '#5cbf2a', solid: true, borderColor: '#18ab29', borderRadius: 28, borderSize: 1, fontColor: '#ffffff', fontFamily: 'Arial', fontSize: 17, paddingX: 31, paddingY: 16, textShadow: true, textShadowColor: '#2f6627', textShadowOffsetX: 0, textShadowOffsetY: 1, textShadowBlurRadius: 0 }; // Insert button into editor jodit.s.insertNode(button); // Open button editing dialog jodit.events.fire('toggleButtonGenerator', button);
Copyconst jodit = Jodit.make('#editor'); // Create link element const link = jodit.createInside.element('a'); link.innerText = 'Go to Website'; link.href = 'https://example.com'; // Apply styles to display as a button const styles = { text: 'Go to Website', href: 'https://example.com', bgStart: '#3498db', bgEnd: '#2980b9', solid: false, // Use gradient borderColor: '#2980b9', borderRadius: 5, borderSize: 1, fontColor: '#ffffff', fontFamily: 'Arial', fontSize: 16, fontWeight: true, // Bold text paddingX: 20, paddingY: 10, boxShadow: true, boxShadowColor: 'rgba(0,0,0,0.3)', boxShadowOffsetX: 0, boxShadowOffsetY: 2, boxShadowBlurRadius: 5, boxShadowSpreadRadius: 0 }; // Insert link into editor jodit.s.insertNode(link); // Open button editing dialog jodit.events.fire('toggleButtonGenerator', link);
Copyconst jodit = Jodit.make('#editor'); // Create button element const button = jodit.createInside.element('button'); button.innerText = 'Button with Shadow'; // Apply styles const styles = { text: 'Button with Shadow', bgStart: '#f39c12', bgEnd: '#e67e22', solid: false, borderColor: '#e67e22', borderRadius: 10, borderSize: 1, fontColor: '#ffffff', fontFamily: 'Georgia', fontSize: 18, paddingX: 25, paddingY: 15, boxShadow: true, boxShadowColor: 'rgba(0,0,0,0.5)', boxShadowOffsetX: 0, boxShadowOffsetY: 4, boxShadowBlurRadius: 8, boxShadowSpreadRadius: 0, boxShadowInset: false }; // Insert button into editor jodit.s.insertNode(button); // Open button editing dialog jodit.events.fire('toggleButtonGenerator', button);
Opens the button generator dialog box. If a button or link element is passed, that element will be edited.
Copyjodit.events.fire('toggleButtonGenerator', buttonElement);
Returns true if the button generator dialog box is open.
Copyconst isOpened = jodit.events.fire('isButtonGeneratorOpened');