"Yash reviewing pull requests at 3:14 AM again..."
Solving Figma Component Variant Bugs: State Mutations, Overrides, and Nesting Glitches
1. The Infuriating Text Override Reset Bug
You carefully type a custom button label (e.g. "Transmit Inquiry"), but as soon as you toggle the variant property to State=Hover or Icon=True, the text instantly resets back to "Default Button". This occurs because layer names inside variant frames do not match 100% identically across variants.
2. The Layer Name Alignment Rule
For Figma to preserve text overrides and icon swaps when toggling component variants, **every single sub-layer inside every variant variant must share the exact same layer name and node hierarchy structure**.
- β Variant 1:
Frame 12 > text_node| Variant 2:Group 4 > label(Text resets) - β
Variant 1:
Button_Content > Label_Text| Variant 2:Button_Content > Label_Text(Overrides preserved!)
3. Component Property Best Practices
Utilize Boolean Properties for toggling icons, Text Properties for string inputs, and Instance Swap Properties for icon selections instead of creating thousands of redundant variant combinations.