Layout & Design

Customizing Vectors with Variables in Framer (Vectors Lesson 4)

Customizing Vectors with Variables in Framer (Vectors Lesson 4)

Customizing Vectors with Variables in Framer (Vectors Lesson 4)

Justin

·

4:59

·

2.6K views

·

About this lesson

In this lesson, we'll cover how to use Variables to create flexible, scalable vector icons without duplication. We'll go over how controlling fill, stroke width, opacity and fill alpha with variables can allow one icon to support multiple styles.

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=0s Introduction

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=21s Recap

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=39s What is a Variable?

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=60s Applying Variables

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=143s Fill Alpha

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=199s Combining Variables

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=232s Variables vs Variations

https://www.youtube.com/watch?v=9fH8H5q_kXM&t=271s Wrap Up

Sign up: https://framer.link/yt

Follow: https://framer.link/yt-x

Learn: https://framer.link/yt-academy

0:00As icons and vectors get reused across0:02layouts and components, they don't0:04always work everywhere [music] out of0:06the box. So, in this lesson, we're going0:08to cover how to use variables in Framer0:10to [music] design flexible vectors that0:12adapt to multiple visual styles without0:15the need to create new icons.0:22In the last lesson, we focused on0:23organizing and building vectors so0:26they're clean and reusable. Now, we're0:29going to build on that foundation by0:31applying variables to our vector sets.0:33But before we get there, let's quickly0:36define what a variable actually is. In0:40Framer, a variable acts like a0:42placeholder for a property value, things0:44like fill color or stroke width, and0:47bring it to the surface when selecting0:49an instance of a vector set or0:51component. That way we can override the0:54value of that property on a per instance0:57basis without affecting the others. And1:00framer gives us different properties we1:02can apply variables to depending on the1:04style of our icons. For example, in this1:08vector set, I'm working with a few1:10common styles. Outline, filled, and a1:14hybrid of the two. Let's start by1:16selecting the outlined icon. Then head1:18over to the layers panel to take a1:20closer look. If we expand the icon, we1:23can see all of its individual paths.1:25From here, I can select a single path to1:28adjust its style properties or select1:31all of the paths and group them together1:34using command G like in the last lesson.1:37So, with this new group selected, let's1:39go ahead and add a variable to the1:41stroke width by heading over to the1:43properties panel and clicking on width,1:46then create variable. Now when we use1:49this icon in a project, we can adjust1:52the stroke width as needed, giving us1:55much more flexibility without creating1:57additional versions of the icon. Next,2:01let's look at the filled version of this2:02icon. For this one, I've already added2:05variables to both the fill and opacity2:08properties, which allow us to control2:10the icon's color and transparency by2:13using the same approach we just used for2:16the stroke width. This works great for2:19icons that are entirely filled or2:22entirely outlined. But when we're2:23working with hybrid or duo tone icons,2:26we often need more control. For example,2:29what if we want to change the opacity of2:32the fill without affecting the stroke?2:34Well, that's where fill alpha comes in.2:37So, looking at this third icon, we have2:40both a stroke and a fill. Instead of2:43adjusting the overall opacity, I'll2:46select the elements that have fills2:47applied to them and then add a fill2:50alpha property by heading to the style2:52section of the properties panel,2:54clicking the plus icon, and then fill2:57alpha. Now, as I drag the slider, we can3:00see the fill becoming more or less3:03transparent, while the stroke stays3:06exactly the same. This gives us precise3:09control over the visual hierarchy within3:11the icon, letting us soften or emphasize3:14parts without changing its structure or3:17creating separate versions. One of the3:19biggest advantages of using variables is3:21that combining them can allow us to3:24switch between outline, filled, and duo3:26tone styles effectively. For example, an3:29outline style might rely entirely on3:32stroke with the fill alpha set to zero,3:36while a filled style would do the3:38opposite, using a solid fill with little3:41or no stroke. And a duo tone style could3:45utilize both. And because all of this is3:47driven by variables, we can change the3:50style just by updating the values. Okay,3:53so up to this point we've been using3:55variables to handle stylistic changes.3:58But when the overall structure of an4:01icon needs to change, that's when icon4:04variations should come into play. A good4:07rule of thumb is use variables for4:10stylistic adjustments and use variations4:13for structural differences. So, if the4:16underlying shape stays the same and4:18we're just changing how it looks,4:21variables are usually the best choice.4:23But if paths are added, removed, or4:26fundamentally different, that's a job4:29for a whole new variation. And that's4:32it. Now you've seen how variables can4:34empower a single icon to support4:37multiple styles, keeping your library4:39consistent, flexible, [music] and easy4:42to scale. In the next lesson, we'll take4:44these icons a step further by covering4:46how to animate them, adding some motion4:49and personality [music] to our designs.4:52I'll see you there.
Also coversComponents

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
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
Creating a fixed footer reveal in Framer6:25
Creating a fixed footer reveal in Framer
Layout & Design7K views · 4 months ago

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