X2e - how to add custom functionality to button

I would like to add some custom functionality to the button on the side of the X2e. The user guide has some vague example but it’s not that helpful. Does anyone know of other documentation or examples?