The Easy Way to Pick Perfect Spacing — Transcript
Full transcript
- 0:00Let's start by setting the right spacing
- 0:02for this list. Should I make it tighter
- 0:04or more spacious? Should I keep the same
- 0:06space for the heading or move it a bit
- 0:08further or closer to the list? But
- 0:10before we start, I need to clarify a few
- 0:13points. This is a 27 in 2K monitor. So,
- 0:17I have scaled the design to make things
- 0:19legible at smaller screen sizes as well.
- 0:21And throughout the video, most of the
- 0:23font size is 1 rim, which is 16 pixels.
- 0:26I will use rem instead of pixels because
- 0:29we want our spacing to scale with the
- 0:31font size. This helps create a spacing
- 0:33system that is consistent and useful for
- 0:36any UI you can imagine. For instance,
- 0:38let's look at this list as an example.
- 0:41If we want to try a smaller gap, we
- 0:43don't have to guess a random pixel
- 0:44value. We can just go like this. And we
- 0:48can do the same for higher values as
- 0:49well. Just increment by 0.25 rem or 4
- 0:53pixels. So at a smaller scale the
- 0:55spacing system looks like this. In most
- 0:58cases you will be reaching for a one rim
- 1:00spacing because most of the elements are
- 1:02one rem font size. For example with this
- 1:05list we can start by setting a one rim
- 1:07spacing between all elements. And then
- 1:09we can increase the spacing for the
- 1:11heading because it is not part of the
- 1:13list itself. And that's the most
- 1:15important role of spacing. Grouping and
- 1:17separating UI elements to help users
- 1:19navigate the interface. For example, if
- 1:22you put equal spacing between these
- 1:23three actions, the UI will look
- 1:25cluttered. Users will have to think for
- 1:27a second regarding which button belongs
- 1:29to which group. Start by grouping the
- 1:32elements with the smallest space
- 1:33possible. Then increase the spacing
- 1:35between distinct groups by one rem. It
- 1:38could be two rem as well if you have the
- 1:40space. It all depends on the context and
- 1:42your preference. Just make sure that
- 1:45this space is smaller than the outer
- 1:47space. For instance, look at a button
- 1:49like this. The inner spacing between the
- 1:51icon and the text should always be
- 1:53smaller than the outer spacing or the
- 1:55horizontal padding of the button.
- 1:57Otherwise, the button will look ugly and
- 1:59confusing to the user. You can use the
- 2:01same spacing if you really want to. But
- 2:03never make the outer spacing smaller
- 2:05than the inner spacing. You only put
- 2:07more inner spacing between elements when
- 2:09they serve a different purpose. In this
- 2:11case, the inner space between the like
- 2:13and dislike buttons is greater than the
- 2:15outer padding. However, if you notice
- 2:17the inner space for the button itself is
- 2:19still smaller than the padding and you
- 2:21can always try a bigger padding so the
- 2:23button looks nice and clean at all
- 2:25screen sizes and of course test
- 2:27different spacing to see which one is
- 2:29the best for your design. But let us get
- 2:31back to these buttons because I want to
- 2:33talk about vertical padding. Have you
- 2:35noticed that the vertical padding is
- 2:37smaller than the horizontal padding?
- 2:39There is a concept called optical
- 2:40weight. Text has more visual noise on
- 2:43the left and right sides because of the
- 2:45varying widths of letters like U versus
- 2:47W. Vertical space is much more
- 2:49constrained by the cap height, which is
- 2:51the height of flat capital letters, and
- 2:53descenders, which are the tails on
- 2:55letters like Y or G. So, if you put
- 2:58equal vertical padding, that unnecessary
- 3:00space will look off and make the button
- 3:02look bloated and ugly. For buttons, just
- 3:05pick a smaller value for the vertical
- 3:06padding and two times or three times the
- 3:09horizontal padding depending on the
- 3:11context. But if you have a lot of
- 3:13vertical elements, you are going to need
- 3:15vertical padding to balance that optical
- 3:17weight. In this case, we have 1.25 rem
- 3:20padding on both sides. So the inner
- 3:22elements have vertical room to breathe.
- 3:24Can you feel the tension if I decrease
- 3:26the padding to one rim and maybe scale
- 3:28it down to its original size? Maybe it
- 3:31looks fine to you, but if you have the
- 3:33space, use it. Because a little extra
- 3:35white space will only make things easier
- 3:37to read. But a tighter spacing can
- 3:39literally hurt user experience. So
- 3:41whenever you want to pick spacing, do
- 3:43not start with a smaller value like.5
- 3:45rem and increase if needed. Instead,
- 3:48start with a bigger value like 1.5 rem
- 3:51and decrease the spacing if needed. Let
- 3:53me show you what I mean by setting the
- 3:55spacing between these inner elements. I
- 3:57am going to use a bigger spacing like
- 3:59one rem. This is obviously too much. So
- 4:02let us try a lower value. This is much
- 4:05better. But the title and author are
- 4:07more closely related than other
- 4:08information. So let us bring them
- 4:10closer.
- 4:12Maybe more. Other than that, I don't
- 4:15think we need to touch anything else.
- 4:17These buttons have a one rim spacing
- 4:19because they belong to the same group.
- 4:21But if you notice closely, they both
- 4:23have one rim horizontal padding as well.
- 4:25So the design looks clean and optically
- 4:27balanced. If you increase or decrease
- 4:29the spacing, the design will still work,
- 4:32but it will not look balanced. You have
- 4:34to train your eyes to notice these small
- 4:35design details. And for me, it has
- 4:38always been Mobin, the sponsor of this
- 4:40video. I use Mobin on a daily basis.
- 4:43Like today, I was designing some cards
- 4:45for this video and was stuck on how to
- 4:47highlight the selected card. So I opened
- 4:49Mobin and searched for selected card.
- 4:52And just like that, I got a lot of
- 4:54professional and clean designs to steal.
- 4:56I mean, take inspiration from. And this
- 4:58is just one example. I cannot tell you
- 5:01how much influence Mobin has on my
- 5:03design choices. I don't have to visit 10
- 5:05different sites and waste hours, if not
- 5:07days, to come up with cool and
- 5:09professional design ideas. Plus, the
- 5:11features and functionality of this site
- 5:13are on another level. And every few
- 5:15weeks, they add a new feature that I
- 5:17never knew I needed. Like when I saw
- 5:20they added animations, I thought, "Yeah,
- 5:22animations are cool." But then later
- 5:24realized, of course, screenshots are
- 5:27nice, but having live animations makes
- 5:29it so much easier to stay on Mobin and
- 5:31study these by playing them on a loop.
- 5:33Mobin is a must have tool if you want to
- 5:35improve your design game. Go check it
- 5:37out. You will find the link in the
- 5:39description. Now, let's get back to the
- 5:41topic and fix the spacing for this UI.
- 5:44As you can see, the typography, colors,
- 5:46and icons are on point. But I kept this
- 5:49tight spacing on purpose. I kept random
- 5:51spacing to separate these three
- 5:53sections. But apart from that, every
- 5:55icon, text, button, and interactive
- 5:57element has.5 REM spacing. Even the
- 6:00padding inside these drop downs and
- 6:02input fields is.5 rem. This is obviously
- 6:05very bad for user experience, but the
- 6:08design might look okay to some of you.
- 6:10That's because of the consistency. Like
- 6:12even if we did not pick the right
- 6:14number, just because the spacing is
- 6:16consistent throughout, we can still make
- 6:18sense of what is what. So the first rule
- 6:20of spacing is being consistent. Even if
- 6:23the number is not right, if you stay
- 6:25consistent, the overall design will look
- 6:27okayish. It might not be very
- 6:29userfriendly, but it will not look as
- 6:31ugly as you might expect. Having said
- 6:33that, let us fix this UI. I am going to
- 6:36start with the first section by setting
- 6:38a generous padding of two rem. As I said
- 6:40earlier, we always start by setting too
- 6:42much spacing and decrease it if needed.
- 6:45Now, step one of picking the right
- 6:47spacing is to break the UI into groups.
- 6:49This title and text are closely related,
- 6:51so they belong to group one. Group two
- 6:54would be these options. And finally,
- 6:56these two buttons will be group three.
- 6:58Let's separate them by setting a gap of
- 7:001.5 rem. You might ask, why this number?
- 7:04Why not one or two rem? I have been
- 7:06doing this thing for a while, so I just
- 7:08know what will work here. But here is a
- 7:10tip. If you want to group closely
- 7:12related elements, use a value below one
- 7:15rim. To separate, use something like 1.5
- 7:19or 2 rem. And one remains
- 7:23used for padding and grouping buttons.
- 7:25But this is just a small tip and not
- 7:27some science or design rule. Spacing
- 7:29always depends on the context. You will
- 7:32see what I mean in a minute. Now group
- 7:34one looks fine to me as.5 rem spacing
- 7:37works really well with closely related
- 7:38elements but these elements definitely
- 7:41need a little more room to breathe.
- 7:43Let's try a bigger value like one rim
- 7:45and see if we need to reduce that gap.
- 7:47This is better for some of you this
- 7:50might be too much but remember we are
- 7:52zoomed in and a little extra spacing is
- 7:54always better than a little tighter. Now
- 7:57although we have equal spacing this
- 7:59section doesn't feel balanced. If you
- 8:01notice, all these options have equal
- 8:03height because of these drop- downs and
- 8:05input field. But the toggle is a bit
- 8:07shorter. So we have to manually set a
- 8:10height to this option. So the spacing
- 8:11feels more balanced. Speaking of
- 8:14balanced, if you remember, we have
- 8:16already discussed optical weight and how
- 8:18we need a bigger horizontal padding for
- 8:20these elements that flow from left to
- 8:21right. 0.5 to one rem. And let's change
- 8:25this gap to space between so it's
- 8:27cleaner and easier to navigate. Same
- 8:29thing for this main action button.
- 8:31People expect these to be on the right.
- 8:33And finally, apply one remal padding and
- 8:36gap to finish this section. But now, I
- 8:39think this two rim padding is probably a
- 8:41bit too much for this section. So, let's
- 8:43do 1.5 instead. Better. Now, we can move
- 8:47on to these two sections. I am sure at
- 8:50this point you already know the next
- 8:52steps. First, break the section into
- 8:54groups. Then apply a bigger spacing like
- 8:56one rim to separate. The first group is
- 8:59already working, but these cards
- 9:01definitely need bigger padding. And if
- 9:03you remember, we usually put the same
- 9:05outer spacing or gap as the inner
- 9:07spacing or padding for a better visual
- 9:09balance. But something still feels off.
- 9:12You see, for these cards, we also need a
- 9:14grid on top of padding, so they all have
- 9:16equal width. You can do this with
- 9:18flexbox or grid, or if you really feel
- 9:21like it, just directly putting a fixed
- 9:23width. Now we can move to section three.
- 9:26But these icons feel too close to the
- 9:28heading. So let's fix that as well.
- 9:30Section three is super easy. Just use
- 9:33space between instead of this 5 rem gap
- 9:36and then separate them with a bigger gap
- 9:38so they have some room to breathe. Let's
- 9:41make these proper squares and fix
- 9:42horizontal padding for this button. Then
- 9:45we just need to bring everything
- 9:46together and fix the spacing between
- 9:48these sections. Let's try to rem. And
- 9:51finally, let's scale it down to original
- 9:54size and compare it to where we started.
- 9:56All we did is group and separate
- 9:58elements using the spacing system. And
- 10:00we just use these values. Two remarse
- 10:04three sections. So actually we just use
- 10:06these three value. So if you do not want
- 10:09to use the full system, just these three
- 10:11can also work for most gaps, margins,
- 10:14and padding. Not only that, but they
- 10:16also make nice round corners as well.
- 10:18Like if you put one rem padding and want
- 10:20optically balanced border radius, these
- 10:23values work really well together.
About this transcript
This page contains the full transcript of The Easy Way to Pick Perfect Spacing by Sajid, generated from the public captions YouTube serves with the video. The transcript has 1,990 words across 279 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.