Skip to main content
Pierre Trochu
May 31, 2025 8:54 AM UTC
Question

How to turn a stroke into a boolean property of my component?

Hello,

 

i’ve created a simple button, with text, padding and autolayout. I’ve turned it into a component. I now want to make the stroke a property for all the variants, that i can turn on and off with a boolean.

However, there is no diamond icon next to the stroke in the right hand panel, so i cannot figure out how to tie it to a prooperty. Is it because the stroke is not a nested item? .

This topic has been closed for replies.

3 replies

Derek_Avila_P
New Participant
Jun 2, 2025 3:42 AM UTC

You can add a rectangle shape to your autolayout frame, set its position to “Ignore autolayout”, manually resize it to the entire autolayout size (you could also use the plugin “Resize to Frame” → “Both” and set its constrains to “Left+Right” and “Top+Bottom” then asign this layer visibility to a boolean property.

sezer
New Member
Nov 3, 2025 9:23 AM UTC

Every property under the “Appearance” section — Fill, Stroke, and Effects — should be able to be added as a standalone nested item. If Figma made a small improvement here, it would be incredible. We’re honestly tired of creating patchwork solutions.

Sandon
New Member
Nov 18, 2025 10:50 PM UTC

For those still looking for a way to do this: Create two components, one with borders and one without. Add a variant property, name it “Border” and set the Values = True/False. Select the components that have borders, set to True. For those that don’t, set to false.