How to build the feature to make center/vertical align when users click the button?

I consider to implement the feature that users can align bubble elements when center/vertical button clicked.

Do you guys know any ways to implement this kind of feature?

スクリーンショット 2023-07-27 13.30.44

This could be done in a few ways, I think it may be possible to have a condition which sets the alignment. So you could have a custom state on the page called, for example “alignment_left” [Yes/No].

Have two buttons “Align Left” and “Align Right” and when a user clicks the button, set the state to Yes or No.

On the icons, add a condition to set alignment Left When custom state is YES.

Or, you could have two sets of icons and hide one set when When custom state is YES and show the other When custom state is NO.

Thank you for the reply. I see. I didn’t know there was the alignment condition!
I’m gonna try that.