Skip to content

Feature request: Instances as variables

Amazing plugin! 🤩 What a fantastic idea, executed very well.

One need this seemed like it might be good for would be switching out icons...I think it would probably be a performance issue if we tried to do them as "selector variables" (we have 150+, used in most of our components) but maybe if the instance could be named and scoped somehow, we could use the variables panel to switch between components?

For instance, if I...

  1. Have a set of icon masters and I name them "<Icon.arrow-up>", "<Icon.arrow-down>", "<Icon.arrow-left>" and "<Icon.arrow-right>"
  2. Use one of them in my Button component
  3. A variable "Icon" would appear in the Button's panel, and I could switch its value between arrow-up, arrow-down, arrow-left, and arrow-right. Doing so would swap the instance to the appropriate component.

The main difference I could see with this being done by the plugin—as opposed to the instance dropdown—would be that it'd keep it up to date if I had several such icons across different button property combinations (e.g. size, variant, state, etc.)