How to create a resizable application header in Figma

Michael Haase
Enterprise Design Talks
5 min readApr 21, 2020

This is the first in a series of posts about my approach to creating reusable components in Figma. Today we’re going to look at how to construct a resizable application header for “Precision”, our design system at the Mainframe Division of Broadcom Inc.

Goals

The final component should allow us to reuse the header in our application form a Figma Library (more on that in a later post) and easily do the following things without detaching the header form the master component:

  1. Change product name and tab labels
  2. Change the type of tab (with icon and without)
  3. Change the state of any given tab
  4. Add and delete tabs

Here is how it should work when we’re done:

The final component.

TL;DR

Create an auto layout component for each of the following:

  1. Tab and interaction states (I know, there are different approaches to do this, but that’s for a later post)
  2. Icon and interaction state
  3. The application name
  4. Group the tabs in an auto layout component
  5. Group the tab component and the product name into another auto layout component
  6. Group the icons into an auto layout component.
  7. Create a regular frame around the two components and set their constraints so that the tabs stay on the left, the icons on the right and both to be vertically centered.

Step 1: The Section Tabs

We’ll start with creating the individual components for the section tabs, the icons and the product name. Below are all the elements were going to be creating.

First, we are going to create the tab component. We want to have a flexible component where we can: a) easily switch between tabs that have icons or not and b) switch between states.

  1. Add a text layer with a line height of 24px and hit “Command + A”
  2. Set the background fill to #3272D9, text to white and the horizontal padding to 16px and the vertical padding to 8px. Add a border radius of 3px.
  3. Next, add the chevron icon. For the sake of this tutorial, we’re going to insert the chevron icon from the Precision Figma Library, and set its size to 10px.
  4. Set the margin between elements to 8px.
  5. Create a component by hitting “Command + K” and rename it to Tab/Icon/Idle or something else that makes sense to you.
  6. To create the tab without the icon, duplicate the component to create an instance and detach it be hitting “Option+Command+B”.
  7. Next, delete the chevron icon and create a new component by hitting “Command+Option+K” again. Rename the new component to Tab/Text/Idle.

Step 2: The Tab States

Next, we are going to create components for the different states. For simplicity’s sake, we will only create the idle, selected and hover states.

  1. Duplicate the component you just created and detach the instance by using “Option+Command+B”.
  2. Change the background fill color to #1E4794 , rename the component to Tab/Icon/Selected and create a new component by clicking “Option + Command + K”.
  3. Repeat for the hover state, where we will use #2C5DB for the background fill and name the component Tab/Icon/Hover.

Great, now you should have six components in total. 3 states for each version of the tabs (with and without icons). You can now easily switch between the states like this:

Step 3: The Icon Buttons

Now we need to create the icon buttons. The process is the same as for the section tabs:

  1. Insert an icon. In our case, we’ll again use an icon component from the Precision Icon Library.
  2. Add auto layout and increase the horizontal and vertical padding so that the icon component is 40x40 pixels.
  3. Set the background fill to #3272D9 and the border radius to 3px.
  4. Create a component and rename it to Header/Icon/Idle.
  5. Duplicate the component to create the selected and hover states, just like we did for the section tabs.

Step 4: Create the Tab Group

Now, let’s group the section tabs, using auto layout:

  1. Create an instance of any tab component by clicking “Command + D” and add auto layout (Command + A).
  2. In the newly created auto layout frame, set the auto layout direction to horizontal and rename the frame to “Tabs”
  3. Select the tab component and duplicate it four times to create five tabs in total. You can create as many tabs as you want, of course.

Step 5: Create the Icon Button Group

  1. Just like we did for the section tabs, create an instance of the icon button component and add auto layout. Set the margin between elements to 4px, the horizontal and vertical paddings to 0px.
  2. Change the icon in the duplicates buttons. Since icons are kept as components in the Precision Library, this is easy to do.

Some Housekeeping

Now is a good time to clean up the layer and component names, so that your header will be easy to reuse in your design projects.

  1. Change the text on the tabs to “Section 1” through “Section 5”.
  2. Rename the tab components in the layer panel to Tab 1–5 or something else that makes sense to you.

Step 6: The Application Name

Now there is only one element left in the left side of the header: the product name.

  1. Create a text layer with a line height of 24px and hit “Command + A”.
  2. Set the vertical padding to 8px and the horizontal padding to 16px.

Step 7: Put it all together

Congratulations, you’ve made it this far. The only thing left to do is to assemble the final header.

  1. Select the application name and the section tabs and create an auto layout component (Command + A). Set the spacing between elements to 40 pixels. Rename the created frame to “Tabs” or whatever yo think makes sense.
  2. Select the newly created “Tabs” and the icon buttons and create a regular frame around them (Shift + Command + G). Why a regular frame? Because you can more easily position the elements individually inside the header than by using auto layout.
  3. Set the constraints of the tabs to be horizontally fixed to the left and vertically to the center.
  4. Set the constraints of the icon buttons to be horizontally aligned to the right and vertically to the center.
  5. Set the background color of the frame to #3272D9.
  6. Congratulations, you’re done!
Putting it all together. Finally!

--

--