Selection event API?

Hey! Thanks so much for your help before! I was wondering if you have any guidance on how to listen to messages when the user has made a selection? So when the user selects a layer, we can run a series on functions?

Figma Community plugin — Contrast makes it easy to check the contrast ratios of colors as you work. Select a layer and Contrast will immediately look for the color directly behind your selection and serve up the contrast ratio along with passing and…

This plugin seems to achieve this, I was wondering if they have any hacks in there or it’s something that is supported?


1 Like

Thanks so much! I’m now trying to listen to those changes in my React app, what’s the recommended approach? I’m finding different implementations on Github

Unfortunately, I can’t help you with this question, but maybe the following article will be useful to you:

1 Like

Very useful, thank you