Back

Changing Width Inside a Component Instance

So there's this annoying thing in Figma where you can't change the width of layers inside of an instance of a component. You can only change the width of that instance directly and everything inside of it will adjust and scale according their position rules. This was causing me a bit of grief as I was building the Input Slider component for the Dixa Design System.

As a start I created a component set with Offset and Value props, with each having options for 0%, 25%, 50%, and 100%. But I really wanted to give the designers using the component the freedom to set the width of the value to anything they need. To open up the possibility of creating more flexible prototypes, or maybe because I don't like accepting that something is impossible.

So my workaround for this limitation in Figma was to leverage Auto Layout properties. As it turns out you can change the value of those properties for layers inside of an instance of a component. Just by converting the frame that wraps the handles and track for the value to Auto Layout, and setting the track to be absolutely positioned, now we can use the Gap property to set any width we want for the value.