Using Figma Variables to Swap Variants Between Modes

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 85

  • @stamatiostentsos4957
    @stamatiostentsos4957 10 місяців тому +9

    So you can't apply the variable to the main component. You have to apply it to the instance. That took me a solid couple of hours to figure out...

    • @stamatiostentsos4957
      @stamatiostentsos4957 10 місяців тому +1

      Do I have to reapply it every time I place an instance of the same main component to a frame?

    • @UICollectiveDesign
      @UICollectiveDesign  10 місяців тому

      Yup unless you are copying from an instance that already has a variable applied@@stamatiostentsos4957

    • @nb7437
      @nb7437 8 місяців тому

      Thanks for this. You just saved me a solid couple of hours.

    • @UICollectiveDesign
      @UICollectiveDesign  8 місяців тому

      @@nb7437 Glad it helped!!! Please share and subscribe :)

    • @Nkreed68
      @Nkreed68 6 місяців тому +1

      @@UICollectiveDesign Do we know if after the Config 2024, we can now apply this directly on the main component? I tried, but did not succeeded yet. Thank you very much

  • @djlv19
    @djlv19 7 днів тому +1

    ...yo!! 2 straight days trying to figure this out...thank you!!

  • @SH-ny8by
    @SH-ny8by Рік тому +6

    Why can’t we apply it to the main component? Only an instance of the component?

  • @whennn
    @whennn Рік тому +10

    What i wish to see is, how do u make it that if u resize the main frame to a mobile size, then the component will change its variable to mobile , like when smaller than 376 then change to mobile varialbe and if bigger than change to PC size and such.

  • @kennethlucas
    @kennethlucas 9 днів тому +1

    Love this! Thanks for sharing. Really simple too.
    However...I have this need to have a left sidebar that collapses.
    So I could easily create a component that has the two variants, expanded and collapsed.
    But can I easily just make a button that swaps the variant on-click?
    For whatever reason I am having a mental block on that right now. Any demo of this?

    • @UICollectiveDesign
      @UICollectiveDesign  9 днів тому

      Great question, I'll look into making a video on building a sidebar, but to answer your question, yes

  • @Bulb22811
    @Bulb22811 4 місяці тому +2

    Thank you, it was exactly what I was looking for

  • @norbertimar
    @norbertimar Рік тому +1

    It seems you can't apply the string directly into the component's property, linking every future instance to the modes. Your method only affects the instances you create and individually link to the string, is this correct?

  • @WilliamRATELADE
    @WilliamRATELADE 11 місяців тому +1

    How do you add a mode to a frame ? the option doesn't seem to appear on my side, on the frame, there is no ''variable'' button next to the layer section

    • @UICollectiveDesign
      @UICollectiveDesign  11 місяців тому

      Is something added to the frame that has a variable applied?

  • @baguetteDuGame
    @baguetteDuGame 6 місяців тому +1

    This is something i am currently working on but i would like to know if there any way that this is automatic. I mean, is there a way that UX designers do not need to assign the variable on the instance property of every component they add.
    I say that because i am building a design system for a huge team of designers and i know for a fact they will not have the patience to do that and i understand why: assigning the variable to the property or simply swaping the variant manually requires as much effort.

    • @UICollectiveDesign
      @UICollectiveDesign  6 місяців тому

      No bulk way to do this I don't think :( At least not that I've found! If you find one please let me know :)

    • @baguetteDuGame
      @baguetteDuGame 6 місяців тому +1

      @@UICollectiveDesign it should be something doable as a plugin

    • @UICollectiveDesign
      @UICollectiveDesign  6 місяців тому

      @@baguetteDuGame Great plugin idea!

    • @baguetteDuGame
      @baguetteDuGame 6 місяців тому

      @@UICollectiveDesign yea well i am not a plugin dev^^

  • @maninoroozi3456
    @maninoroozi3456 11 місяців тому +1

    If for example you want to resize a button component between desktop and mobile the variable for some reason resets the button attributes to default.

    • @UICollectiveDesign
      @UICollectiveDesign  11 місяців тому

      A lot of bugs still with Figma variables unfortunately

  • @naz95naz
    @naz95naz Рік тому +1

    Is it possible to implement switching from a light theme to a dark theme and vice versa through the variable mode using a component variant?
    Let me write an example. There is a toggle on the frame that switches the frame mode from light to dark, but it changes the mode of the current frame, not the transition to another frame. Is this possible?

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому

      Nope - You could have both prototypes in light and dark mode, but just have the switch as the gateway between the two

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому

      As it would be in a legacy prototype

  • @arturpavlenko
    @arturpavlenko 7 місяців тому +1

    Cool! But I've faced one issue - I cannot apply this to nested components. Is there any solution?

    • @UICollectiveDesign
      @UICollectiveDesign  7 місяців тому +1

      Nope! Unfortunately Figma has not evolved to this level yet

    • @arturpavlenko
      @arturpavlenko 7 місяців тому +1

      @@UICollectiveDesign thanks

    • @UICollectiveDesign
      @UICollectiveDesign  7 місяців тому

      @@arturpavlenko Happy to help :) Please subscribe and share our channel where you can :)

  • @jonrivera9704
    @jonrivera9704 7 місяців тому +1

    when selecting the desktop frame, I dont see the local variable icon. is this a paid feature in figma?

    • @UICollectiveDesign
      @UICollectiveDesign  7 місяців тому

      Do you have any elements inside the frame? You also need to have variables created

  • @ytRap007
    @ytRap007 10 місяців тому +1

    Can you make avideo that applies changing the state of a button to selected state when clicking?

  • @tara730
    @tara730 5 місяців тому +1

    why your videos is not in the high quality

    • @UICollectiveDesign
      @UICollectiveDesign  5 місяців тому

      This is a much older video from when I first started. All new videos are in improved format

  • @ViruX93
    @ViruX93 4 місяці тому +1

    Beside the fact not being able to asign variables to main components / variants I would like to be able to assign multiple variables as I want to cover more than just 2 viewports but not every viewport has its own variant.

    • @ViruX93
      @ViruX93 4 місяці тому +1

      Please vote for "relating-component-variants-to-variable-modes" in the figma forum.

    • @UICollectiveDesign
      @UICollectiveDesign  4 місяці тому

      Agree! This is something I wish Figma would have released by now

  • @genatroce
    @genatroce Рік тому +1

    I wanted to replicate this for myself, and unfortunately I noticed a small problem (on the Firgma side) - I can't create a string variable in the component library and then use it that way in other files. It only works on local components and variables.

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому

      You have to detach components. See our most recent video for an example

  • @captivatingcurios
    @captivatingcurios Рік тому +1

    I'm working with a changing button, so this is perfect. Thanks!!

  • @Helen_Matveyeva
    @Helen_Matveyeva 2 місяці тому +1

    Thank you, it has been very useful

  • @rb8365
    @rb8365 Рік тому +3

    Great video, but downvote for unskippable long ads

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому

      Only was able to monetize recently. Let me fix this now, still have no idea what I do / do not have control over. Let me investigate

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому +2

      Should be fixed now. Sorry about that!

    • @rb8365
      @rb8365 Рік тому +3

      Wow. Quick and great response. Switched downvote into upvote for such a great service.

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому +1

      @@rb8365 haha, I appreciate he heads-up on the ads!

  • @SantiagoBotero-p4g
    @SantiagoBotero-p4g Рік тому +1

    Mate, this video is gold! Thanks a lot 🤟

  • @erikfadiman
    @erikfadiman 8 місяців тому +1

    This is so helpful, Thank you so much!

  • @humbertoventura1344
    @humbertoventura1344 9 місяців тому +1

    Thi does not work if you component set has several interactions, Jesus!!

  • @iamavro
    @iamavro Рік тому

    I have been enjoying your videos recently and the process you follow to create components. Thank you!
    Request: Can you please deep dive into input fields? Everyone has this one liner input fields. They don't cover where the field can have multiple lines, or just the text box will stop expanding after 3 lines. It's such a complex component to make and I'm struggling.

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому

      These are available on our website as part of our all-access pass :)

    • @iamavro
      @iamavro Рік тому

      @@UICollectiveDesign Thanks. Will check.

  • @tanoyist
    @tanoyist Рік тому +1

    This is so helpful. thanks for sharing

  • @LudvigAristarhovi4
    @LudvigAristarhovi4 Рік тому +1

    It is very usefull, thank you

  • @Cinki
    @Cinki Рік тому

    Can you do create a more realistic example with component of 3+ properties? ;)

    • @UICollectiveDesign
      @UICollectiveDesign  Рік тому

      Can you elaborate?

    • @whennn
      @whennn Рік тому

      I think he means , what happens when u have 3-4 variants , how do you link this to the variables@@UICollectiveDesign

    • @yoanadotina5395
      @yoanadotina5395 Рік тому

      I also have been struggling with that

  • @offshare2033
    @offshare2033 Рік тому +1

    Thanks.

  • @yashjain9935
    @yashjain9935 7 місяців тому +1

    very less original loudness of the video

  • @jonibekbekmuratov2798
    @jonibekbekmuratov2798 Рік тому

    great

  • @rjabrm
    @rjabrm Рік тому +1

    waist of time all that vars