Skip to content

Side Buttons v316+ ​

The side buttons are buttons that appear vertically along the right side of the editor screen.

Description ​

acode.require("sideButton") creates and renders custom side buttons that users can interact with.

Usage ​

js
const SideButton = acode.require('sideButton');

const sideButton = SideButton({
  text: 'My Side Button',
  icon: 'my-icon',
  onclick() {
    console.log('clicked');
  },
  backgroundColor: '#fff',
  textColor: '#000',
});

// Show the side button
sideButton.show();

// Hide the side button
sideButton.hide();

API Reference ​

Options ​

NameTypeDescription
textstringThe text label for the button
iconstringCSS class name for the button icon
onclick() => voidClick handler function
backgroundColorstringBackground color of the button
textColorstringText color of the button

Returns ​

Returns an object with the following methods:

MethodTypeDescription
show() => voidShows the side button
hide() => voidHides the side button

Released under the MIT License.