Skip to main content
Question

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

  • May 31, 2025
  • 3 replies
  • 506 views

Pierre Trochu

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? .

3 replies

Derek_Avila_P
  • New Participant
  • June 2, 2025

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
  • November 3, 2025

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
  • November 18, 2025

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.