Layout & Design

Framer Update: Stack Variables

Framer Update: Stack Variables

Framer Update: Stack Variables

Benjamin

·

4:17

·

17K views

·

About this lesson

This release adds support for Stack Variables within Components and CMS. This means you can now turn properties like Gap, Padding, Direction, Distribute, and Align into customizable controls, allowing you to design much more flexible Components. For things like Navigations, this means you have to rely less on Variants for responsiveness across Breakpoints, and can instead use Variables, allowing you to keep Variants for interactivity. An example of this can be seen in the video above. The addition of these Variables also enables you control layout via CMS Items, unlocking exciting new use cases. Variable support for the Wrap property is coming soon too. Please let us know which ones you’d like to see next in the Community. https://framer.com/updates/stack-variables/

🌞 Try Framer for free: https://framer.com

🎉 Follow on Twitter: https://twitter.com/framer

💎 Join Community: https://www.framer.community

0:00yo my name is Benjamin and in this video0:04let's talk about stack variables we're0:08adding variable support for layout0:10properties in components this allows you0:13to make much more customizable0:15components like navigations and it even0:18allows you to control layout through the0:21CMS let's take a look at a navigation0:25use case here I have this pop out menu0:28from nav do Supply you can click0:32anywhere on the collapsed menu to open0:35it revealing a horizontal layout of0:38links when you resize down to a phone0:41break point the links become vertical0:45and the Gap is adjusted as well so let's0:48dive in and take a look at how this demo0:51currently is set up and how we could0:54further simplify it using variables we0:58currently have four unique variants open1:02closed mobile open and mobile closed and1:07in the mobile or phone variants all1:11we're really doing is customizing the1:14stack Direction and The Gap now before1:18this was really the only way to do this1:20kind of layout customization within a1:23component but increasing your variant1:26count can be prone to error especially1:29when collaborating with multiple people1:31in a project for example you could1:34accidentally create unwanted layout1:37overr rights in the phone variant so1:41ideally because this navigation has two1:43states we could also use two variants so1:47I'll go ahead and delete both of the1:50mobile variants and now we simply have1:54an open variant and a closed variant so1:58I'll select this step T containing all2:01of our links and there's really only two2:03properties we need to customize on the2:06phone breakpoint we want to set2:08direction to vertical and GAP to 20 I'll2:13go ahead and undo these changes here and2:16let's make our first layout variable2:20I'll click on the direction property and2:23then I'll select create variable the2:26current default is horizontal which is2:29what we need for the desktop and tablet2:31breakpoints here so that is fine let me2:35close out of the variable model and2:38let's do the same for The Gap property2:41it inherits our default of 10 and I do2:46like a stepper control so I'll customize2:49that and then let's go back to the2:53homepage so you can see the variant we2:55used on the phone breakpoint got reset2:58back to the primary variant which is3:01expected because we deleted those3:04variants and now When selecting any3:07instance of our component we have new3:10property controls for both Direction and3:14GAP and we can use these to fix our3:17navigation on the phone break points3:20I'll set direction to vertical and I'll3:23increase the Gap to 20 and that is3:26looking fine so let's set the variant3:29back to closed and give this a3:33preview and if we now expand and3:36collapse the navigation you'll see we3:39have a vertical layout on3:41mobile and a horizontal one on3:46desktop so the interactions are powered3:49by two variants while the responsiveness3:52is powered by two variables giving you a3:55very flexible setup that is easy to3:58customize and and that's pretty much it4:01for this video thank you so much for4:04watching and stay tuned for more updates4:08coming4:15soon

Watch on YouTube ↗

More in this topic

8 Framer shortcuts you're probably sleeping on4:19
8 Framer shortcuts you're probably sleeping on
Layout & Design3K views · 2 months ago
Framer Update: Stack Sorting and Bento Grids2:16
Framer Update: Stack Sorting and Bento Grids
Framer Update7K views · 2 months ago
Sharing Vector Sets Across Projects (Vectors Lesson 7)3:41
Sharing Vector Sets Across Projects (Vectors Lesson 7)
Layout & Design1K views · 3 months ago
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)3:38
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)
Layout & Design2K views · 3 months ago
Animating Vectors in Framer (Vectors Lesson 5)4:25
Animating Vectors in Framer (Vectors Lesson 5)
Layout & Design4K views · 3 months ago
Customizing Vectors with Variables in Framer (Vectors Lesson 4)4:59
Customizing Vectors with Variables in Framer (Vectors Lesson 4)
Layout & Design3K views · 3 months ago
Replace component instances site-wide in Framer1:39
Replace component instances site-wide in Framer
Layout & Design4K views · 4 months ago
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)6:58
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)
Layout & Design3K views · 4 months ago

Create a free website with Framer, the website builder loved by startups, designers and agencies.