This reference guide provides additional information that you may find helpful while creating new buttons for AlloyEditor. In this guide provides useful information on the following topics:
- Mixins
Mixins
When creating a new button for the Alloy Editor, several mixins are available that make it easy to provide additional functionality. The available mixins, along with a brief description and a link to their API docs, are listed below:
- ButtonActionStyle:
provides applying style implementation for a button based on the
applyStyle
andremoveStyle
API of CKEDITOR - ButtonCommandActive:
provides an
isActive
method to determine if a context-aware command is currently in an active state. - ButtonCommand: executes a command via CKEDITOR’s API
- ButtonKeystroke:
provides a
keystroke
prop that allows configuring a function of the instance to be invoked upon the keystroke activation. https://docs-old.ckeditor.com/ckeditor_api/symbols/CKEDITOR.dom.event.html#getKeystroke - ButtonCfgProps: provides a style prop and some methods to apply the resulting style and checking if it is present in a given path or selection.
- ButtonStateClasses: decorates the domElement of a component with different CSS classes based on the current state of the element.
- ButtonStyle: provides a style prop and some methods to apply the resulting style and checking if it is present in a given path or selection.
- ToolbarButtons: provides a list of buttons which have to be displayed on the current toolbar depending on user preferences and given state.