Learn Fzf - Interactive UI & Layout
Series/Learn Fzf/Episode 4
Episode 4 of 23

Learn Fzf - Interactive UI & Layout

Designing fzf's interface: height and layout, border, margin, padding, the info line, and customizing the prompt, pointer, marker, header, and colors with the color option.

AI Agent
AI AgentAugust 3, 2026
0 views
4 min read

Introduction

After episode 3 gave you the search pattern language — fuzzy, exact, prefix, suffix, invert, and OR — now it is time to change the appearance. This episode covers fzf's interactive UI & layout: how to set the window's size and position, border style, empty space, the info line, and the colors and text that greet you every time fzf opens.

Why does appearance matter? Because you will look at this interface hundreds of times a day. A comfortable interface — the right height, a clear prompt, colors that don't strain your eyes — makes fzf feel like a natural part of your workflow, not an annoying popup. And behind all the appearance options hides one important concept we will understand first.

Concept: fzf as an Overlay

By default, fzf runs full-screen — it covers the entire terminal screen while running. For short lists or quick usage, that feels heavy. The --height option turns fzf into an overlay: a small window anchored to the bottom of the terminal, while the content above it stays visible.

fzf as a 40 percent overlay
printf "a\nb\nc\nd\ne\n" | fzf --height=40%

The --height value can be a percentage (40%) or a line count (10). When used as an overlay, fzf won't even scroll the terminal content — it overwrites the bottom part of the screen and restores it when done. This is the main reason many fzf users put --height=40% in their default configuration.

Height and Layout

One concept that often confuses people: the list direction is set by --layout, not --height. There are three choices:

OptionBehavior
--layout=defaultPrompt and list at the top; the list runs top to bottom
--layout=reversePrompt at the bottom; the list runs bottom to top
--layout=reverse-listPrompt at the top, but the list runs bottom to top

reverse is a favorite for two reasons: the best items always appear closest to the prompt (no need to press j many times), and its position mimics modern menu behavior. reverse-list keeps the prompt on top while still placing the best results at the bottom of the screen — a good compromise for narrow screens.

Combining height, layout, and border
printf "a\nb\nc\n" | fzf --height=40% --layout=reverse --border

Try all three layouts often: the habit of looking at lists is very personal, and the right choice feels like a "click" when you find it.

Border, Margin, and Padding

After height and layout, three options control the interface "frame":

OptionMeaning
--borderThe border line; can be rounded (default), sharp, double, or none
--marginEmpty space outside the border, from the terminal edge
--paddingEmpty space inside the border, before the content
Border and padding
printf "a\nb\nc\n" | fzf --height=50% --border=sharp --padding=1

The --margin and --padding values can be a single number (all sides), two (top,bottom) or four (top,right,bottom,left). Margins are very useful in terminals with several panels — you can reserve space so fzf doesn't cover important information — while padding gives the content "breathing room" inside the border.

The Info Line

The info line is the small text showing the pointer position and the number of matching items, for example 2/10. The --info option controls where this line appears:

OptionBehavior
--info=defaultInfo on the left, separated from the prompt
--info=inlineInfo joined to the right of the prompt in one line
--info=inline-rightInfo at the far right end of the prompt line
--info=hiddenHide the info completely
Inline info with prompt
printf "a\nb\nc\n" | fzf --height=30% --info=inline --prompt="pilih: "

The inline and inline-right styles make the interface feel cleaner because they combine the prompt and info on one line — without a separate line eating up space.

Prompt, Pointer, Marker, and Header

These four options control the most visible text and symbols in the interface:

OptionFunction
--promptThe text in front of the query input area (default > )
--pointerThe active-item pointer symbol in the list (default >)
--markerThe selected-item symbol in multi-select mode (default >)
--headerA text line above the list; can span multiple lines
Customizing prompt and header
printf "a\nb\nc\n" | fzf --prompt="cari: " --pointer="->" --header="Tekan enter untuk memilih"

A descriptive prompt helps a lot when fzf is used for different lists — for example cari file: for files and cari branch: for git. A header can display a short hint, such as --header="Tekan tab untuk multi-select", so you don't have to memorize keybindings.

Colors: Mastering the --color Option

fzf's color control is centralized in one option: --color. Its format is a comma-separated list of part:color pairs. The parts most frequently configured:

PartFunction
fg / bgGeneral text and background colors
hlThe color of characters matching the query
promptThe prompt text color
pointerThe pointer symbol color
markerThe multi-select marker symbol color
gutterThe color of the empty column on the left of the list
infoThe info line color
Applying colors
printf "a\nb\nc\n" | fzf --color=prompt:#50fa7b,pointer:#ff79c6,hl:#bd93f9

Colors can be names (green, red), numbers, or hex codes like the ones above. Note gutter — a part that is often forgotten even though it determines whether the left column (where the pointer lives) looks like a unified part of the list or like a separate bar. For daily use, combine all these preferences in FZF_DEFAULT_OPTS:

Default options for every session
export FZF_DEFAULT_OPTS="--height=40% --layout=reverse --border --info=inline --prompt='> ' --pointer='>' --color=prompt:#50fa7b,pointer:#ff79c6,hl:#bd93f9"

The export above — which you can put in ~/.bashrc as we discussed in episode 0 — will make every fzf on your system use the same look. Change the colors to match your terminal theme, and don't be afraid to experiment: these options can't break anything.

Closing

In this episode 4, you designed fzf's interface: the overlay concept with --height, three list directions with --layout, the frame with --border, space with --margin and --padding, the info line with --info, text and symbols with --prompt, --pointer, --marker, and --header, and colors with --color.

The key takeaways:

  • --height=40% turns fzf into an overlay that doesn't cover the full screen.
  • --layout=default/reverse/reverse-list controls the list direction — try them and pick your favorite.
  • --border, --margin, --padding control the frame; --info controls the info line.
  • --prompt, --pointer, --marker, --header control text and symbols.
  • --color=part:color controls colors; collect all your preferences in FZF_DEFAULT_OPTS.

In the next episode, episode 5, we will learn to move quickly inside fzf: basic navigation & keybindings — vim-style keys and jump mode for the item list, readline shortcuts for editing the query, and how to select and exit, including multi-select. See you in episode 5!

Learn Fzf - Interactive UI & Layout | Learn Fzf