Tap to Dismiss
Published in

Tap to Dismiss

Building a Design System Library

How we created the Lyft Product Language attributes and component libraries

Zoomed in view of Figma project folders with files in them.

System-ception: a system within a system

When we started to tackle creating our system in Figma, we took a step back to reevaluate what we’d done in Sketch, questioning the decisions we’d made about layout, visual hierarchy, and naming convention, to name a few. We realized that in order to create a strong foundation in these new libraries, we had to take the time to create a system within a system that would apply to every element in the file. In the end, we essentially built in a certain level of quality and consistency into the library which allowed us to scale the number of library maintainers.

Carousel Page Indicator main and internal components. Note the file canvas has a #F4F4FA background fill.
A system of padding
  • 60px: Internal Frame padding (top, right, bottom, and left)
  • 40px: Between Frame title to 1st main component
  • 24px: Between Frame title to Subtitle (optional)
  • 24px: Vertically between main components
  • 40px: Horizontally between main components
Layers reordered visually from top to bottom
Naming convention applied to the focus compact button
Visual of the folder structure in the Instance dropdown

More flexible components

Creating atomic elements is the foundation of a design system. The Lyft Product Language is broken into atomic elements and then used to create specific components. These internal components help provide consistency across a large team (ie buttons) as well as cut down on maintenance, especially when these internal components are shared across multiple components (ie text field, text area, dropdown, etc).

List item component consists of 3 areas: Start, Middle, and End
Internal components allowed for the Start area
Internal components allowed for the Middle area
Internal components allowed for the End area

Let’s talk about responsiveness

There are other things to consider when creating flexible, shared components that respond in the exact way you intend. A lot of these options can be defined in the Design panel within the Figma interface.

The design panel in Figma: source
Horizontal constraints: source

Horizontal constraints

  • Left pins the layer to the left side of the frame.
  • Right pins the layer to the right side of the frame.
  • Left and right allows the layer to grow or shrink along the x-axis.
  • Center allows the layer to float towards the horizontal center of the frame.
  • Scale allows the layer to grow or shrink as a percentage of the Frame’s dimensions.
Example of horizontal constraints settings for a List Item component.
Vertical constraints: source

Vertical constraints

  • Top pins the layer to the top of the frame.
  • Bottom pins the layer to the bottom of the frame.
  • Top and bottom allows the layer to grow or shrink along the y-axis
  • Center allows the layer to float towards the vertical center of the frame.
  • Scale allows the layer to grow or shrink as a percentage of the Frame’s dimensions.
Example of vertical constraints settings for a Text Area component
#8 bullet — type resizing options: Auto Width, Auto Height, and Fixed Size: source

Auto Width

This option allows your text layer’s width to grow based on your content. I typically set a text layer’s width to auto width when wanting my layer to grow based on my content. By setting the horizontal constraints to the left along with the auto width option, my text layer will resize accordingly.

Example of auto width text settings for a Text Area component

Auto Height

This option allows your text layer’s height to grow based on your content. The original text layer’s width will dictate when your content wraps to a new line. I typically set a text layer’s height to auto height when wanting my content to wrap to a second line within a component. By setting the horizontal constraints to left and right along with the auto height option, my text layer will wrap the way I intend it to.

Example of auto height text settings for a Text Area component

Fixed Size

This option sets your text layer’s width and height, no matter the content. The text layer’s set width will dictate when your content wraps to a new line and will extend past the text layer’s set height without being clipped.

Responsive buttons using Auto Layout: source
Wrapping text shifts other elements: source
Automatic reordering is easy with Auto Layout: source

Tricks of the trade

I utilize keyboard shortcuts on a daily basis to help me work more efficiently within all the component libraries the Design System team manages. Some of these exist in other design programs and others are neat pro-tips that make it easier to work in Figma.

  • Select All with Same Instance. When needing to rename a number of internal components within a page full of main components, simply navigate to the Edit menu and select Select All with Same Instance.
Edit > Select All with Same Instance: source
  • Create a component. Any design system designer knows they’ll be creating components until the cows come home. I type Option + Command + K frequently to quickly create a component.
  • Rename layer(s). Figma’s default renaming feature is super powerful. Selecting multiple layers and typing Command + R triggers a Rename Layer modal with more renaming options including find and replace, ascending and descending numbers, and prefixing or appending to the current name.
Command + R when multiple layers are selected: source
  • Paste over selection. Paste in place, for those who cut their teeth in Illustrator, was the most common feature I used. In Figma, you simply type Shift + Command + V (while something is already selected) to accomplish this.
  • Zoom in on layer. To quickly zoom in on a layer, simply double click on that layer’s icon in the Layers menu.
Quickly zoom in on any layer: source
  • Component descriptions. This is a way to communicate specific details about your component. It displays when you hover over an Instance in the Assets and Code panels. We utilize this area for handoff information to our engineering partners.
Engineering handoff information placed in the component description: source
  • Ignore constraints. Sometimes you want to temporarily ignore the horizontal and vertical restraints you set on your component layers. To do this, simply hold down Command while resizing your component. Release Command if you want to honor the constraints.
  • Prevent auto nesting. A frustrating thing I discovered when moving layers around the canvas is it would automatically place them in other frames. To prevent this from happening, hold Spacebar while dragging your layer around.
  • Instance swapping. This is a pro-tip that can be used to swap any instance but I’ve used it specifically to replace icons; hold Option when dragging a component from the Asset panel. There’s an added efficiency as well since you can use the Asset panel search field, too.
Replace icons like a boss: source

Last thoughts

When I first created Airbnb’s component library, it was the first time I ever touched a design system. I learned as the library materialized and thanks to the system within a system concept that I utilized at the beginning, I was able to take something as complex as a design system and present it in a way that had consistency, quality, and flexibility built into its foundation. That’s the recipe for how I helped build Lyft’s design system in Figma. Are there any best practices that you’ve utilized to build your design system? Leave a comment below!

--

--

Sweating the details so you don’t have to

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeremy Dizon

Product Design / Design Systems super-monkey 🐵 | @jeremydizon on Twitter 💬