Creating a responsive component with boolean variables / Figma

Поділитися
Вставка
  • Опубліковано 25 лип 2023
  • Learn how to use boolean variables to set up just ONE responsive header component for multiple breakpoints.
    Playground file: www.figma.com/community/file/...
    01:21 Setting up variables and mode
    03:28 Connecting header component to variables
    For more practice with variables, check out these tutorials:
    • Dynamic prototyping wi...
    • Light/dark mode and th...
    • Gentle intro to Figma'...
    • How to instantly add c...
    Note: you need to have Figma pro (or above) to use multiple modes for variables. If you would like to upgrade, you can use my link: letsbuild.click/figma-pro. This is an affiliate link, which means I'll be compensated monetarily if you join 💸
    🎓 Also, if you're a student, you get access to Figma pro for free!! Just verify your education status and enjoy all these cool features: figma.com/education/
    #figma #figmatutorial #figmavariables

КОМЕНТАРІ • 45

  • @mash312
    @mash312  11 місяців тому +5

    The actual variables part starts at 1:21 if you'd like to skip over the demo!
    Also, some thoughts: on one hand I love variables because you no longer have to manage duplicate subcomponents separately. It's quite a sleek experience once you get the hang of it. On the other hand, I think it's still not very obvious to somebody using the component that it could appear differently in different modes. (Even more so, it's hard to tell right away that there are different modes available in the first place).

  • @sayekatchakraborty4621
    @sayekatchakraborty4621 11 місяців тому +2

    This time sound quality and your voice tone were good, Masha! Keep going ❤ Thank you 🎉

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

      thank you! :)

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

    Great tutorial, thanks!

    • @mash312
      @mash312  9 місяців тому

      thank you! :)

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

    This is awesome, thanks for sharing!

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

      thank you :)

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

    That was super clear and enlightening 💡 Thanks!

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

      awesome, thank you so much 🙌

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

    Super clear tutorial, thank you!

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

      thank you :)

  • @diogomendonca1798
    @diogomendonca1798 3 місяці тому

    Awesome content. Quick and right to the point

    • @mash312
      @mash312  3 місяці тому

      thank you :)

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

    Wow. Thanks for your content

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

      thank you :)

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

    Amazing 😊

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

      thank you :)

  • @user-zs8pk8nd8x
    @user-zs8pk8nd8x 8 місяців тому

    Very helpful! Thanks :-)

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

      thank you :)

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

    sick!

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

      thank you :)

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

    you are amazing keep it up 👍

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

      thank you so much 🤍

  • @TheTiiatia
    @TheTiiatia 9 місяців тому

    Hello Masha, thank you for such a good and well described video!
    I was also wondering if you have tried to create tables? As in desktop table is a large wide card, but the smaller we go the more compact the card gets & some stuff goes under each other... Thanks!

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

      thank you so much :)
      For spacing/compactness, you can definitely utilize the variable modes for it! (And then you can reuse that not just for the card but other components too).
      For stuff that changes orientation, I'd probably still stick to creating variants for that (because currently there's no way change direction based on modes). Or, as a workaround, you could use boolean variables to hide some content in desktop view and display it mobile view (and vice versa). I'd probably not do that, because then you have duplicate content to maintain :/ Lastly, you could utilize auto layout wrapping, depending on the structure of your card.
      And no, I haven't tried making a component like that yet with variables but that sounds like a fun challenge 😏

  • @robertovenditti1515
    @robertovenditti1515 9 місяців тому

    That is great, thank you :). Any other good use case for boolean variables in design systems that you could think of?

    • @mash312
      @mash312  9 місяців тому

      thank you! :) ohh probably so many, but the only ones I can think of at the moment is anything that could be hidden in desktop vs. mobile vs. tablet mode (headers, footers, card content, etc...).

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

    Very neat, thank you! Does this pose issues when creating micro interactions? Such as hover states, overlays, etc. It makes sense when you have variants that you can just prototype link with...but with variables and booleans...there doesn't seen to be a way to do this, right?

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

      hey! thank you :) and you can definitely combine component interactions with using variables - it all should work when prototyping

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

    Now we know it

  • @andersonaf
    @andersonaf 9 місяців тому

    Hi there, do you know if with conditional would be possible to change the variables while you resize a canvas?
    I'm trying to find it.
    Thank you for the content!

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

      hi Anderson, thank you so much! I tried to play with it and unfortunately, I don't think it's possible at the moment (variables are tied to modes which can only be changed by changing the layer type...).

  • @user-ib8yq4hm2c
    @user-ib8yq4hm2c 9 місяців тому

    Hi! It's a simple but great tutorial.
    I'm deep diving a little into Figma variables, and I was wondering wat else I can do. I would like to have different type of width in different modes (like, fill container in mobile and hug in desktop, for buttons). Do you know if it's possible?

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

      hi Laura, thank you!
      Unfortunately we can't set auto layout properties (fill container, hug) as variables.
      But, one workaround you could use is have a number variable for min-width for Phone and Desktop modes. For Phone it could be ~370px (or whichever size you need to make it look like it "fills" the container) and Desktop ~96px. Of course this isn't ideal because the values are still fixed.
      Here's demo file if helpful: www.figma.com/file/WqwMhSQKfFNcL5VxLVfdwJ/button-on-phone-vs.-desktop?type=design&node-id=0%3A1&mode=design&t=BbRo4jC6GKmOk3Ez-1

    • @user-ib8yq4hm2c
      @user-ib8yq4hm2c 9 місяців тому

      @@mash312 Thank you very much!

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

    If you want to have a sidebar open up on the mobile’s menu, will this method work if you have different states for the breadcrumb? Thanks!!

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

      It should! You’d just have variants for different states

  • @PAdam-vq4wq
    @PAdam-vq4wq 6 місяців тому

    I want to change the navbar height based on breakpoints. Because I want to show different logo variant on different screens (e.g: on mobile: logo image only, tablet & desktop: logo + brand name). Can I achieve that with this variables?

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

      yes, you should be able to add a number variable for height and then bind it to the height value of the navbar

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

    genius

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

      thank you!

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

    Its not changing when i move it between frames.

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

      are your frames assigned to modes as well? I sometimes forget to do that and then it doesn’t change 🙈

  • @humbertoventura1344
    @humbertoventura1344 2 місяці тому

    This does not work if you have a component with several interactions, Jesus!

    • @mash312
      @mash312  2 місяці тому

      yeah, there're some limitations 💔sorry