Skip to content
All terms
Components/lexicon/ghost-button

What is a ghost button?

A ghost button is a transparent button with just a thin outline and a text label, used for secondary actions beside a bolder primary button.

Made ofA button with a transparent fill and a thin outline that gains a fill on hover and focus.

Key CSSbackground: transparentborder: 1px solid currentColor
01 · Definition

Look at almost any hero section. A loud, filled button says Get started. Next to it sits a quieter one that says See how it works, with no fill, just a thin outline and a label. That quiet one is a ghost button. It is there, it is clickable, and it is politely staying out of the primary button's way.

The definition is short: a transparent background, a hairline border or no border at all, and text. Because there is no fill, a ghost button inherits whatever it sits on. That makes it handy over photographs, gradients and dark sections, where a solid secondary button might clash. It became a fixture of photo-heavy hero sections through the 2010s and has stayed because it solves a real problem: giving people a second choice without making it compete with the first.

Naming is a mess, so expect to translate. Material calls it an outlined button, Bootstrap has outline variants, and Ant Design literally has a ghost property. Some teams use ghost for the outlined version and reserve a separate tertiary or text button for the no-border version. The useful mental model is a three-step ladder: filled for the main action, ghost or outline for the secondary one, plain text for the tertiary one. Every screen should have at most one rung-one button.

The risk is invisibility. A ghost button has the least visual weight of the lot, which is the point, but it can slide into being the thing people miss. If it is the only button on the screen, people may not read it as a button at all. If its border is a pale 8% grey on a white page, some users will not see the edge. Contrast guidance asks for roughly 3:1 on the boundary of an interactive control and 4.5:1 on its text, and over a photo that can change from one corner to another. A subtle dark overlay under the button, or a backdrop blur, can save you.

States matter more than usual. Because the resting state is almost empty, the hover state has to do the persuading. A faint background tint, a colour shift on the border or an underline all work. Add a visible keyboard focus ring too, since a transparent button with no focus style is a ghost in the bad sense.

A few habits that keep it useful:

  • Always pair it with a filled primary button nearby.
  • Match the ghost button's height and padding to the primary so the pair looks like a pair.
  • Use a hairline border at roughly 8 to 12% opacity on light surfaces, and push it higher when it sits on imagery.
  • Make the tap target at least 44px tall on touch screens.
  • Do not use ghost buttons for destructive actions or as the sole call to action.

When you ask an AI for it, describe the pair rather than the single button. For example: primary button with a solid near-black fill, white text and a height of 44px, secondary ghost button with a transparent background, a 1px border at 24% opacity, the same height and padding, a hover tint of 6%, and a 2px focus ring with a 2px offset. Models respond well to concrete state definitions.

Use when
  • Secondary actions next to a primary CTA
  • Cancel / dismiss actions in dialogs
  • Buttons that need to sit on imagery without breaking it
Avoid when
  • Primary actions (low contrast hurts conversion)
  • Single-button contexts (no need for hierarchy)
02 · Do
  • +Pair every ghost button with a filled primary nearby
  • +Use a hairline border (8–12% alpha) for definition
03 · Don't
  • −Don't use ghost buttons as the only CTA, users miss them
06 · Common questions

Ghost Button: your questions, answered

When should I use a ghost button?

Use one for secondary or tertiary actions that sit next to a primary button: Cancel, Skip, Learn more, See pricing. It also suits places where a filled button would be too loud, such as dense toolbars or buttons placed over photographs.

What is the difference between a ghost button and an outline button?

In practice the two terms overlap. Outline usually means a visible border with no fill. Ghost sometimes means the same thing and sometimes means no border at all, only a hover background. Check how your design system defines them.

How do I make a ghost button easy to notice?

Give it a clear border with enough contrast, a visible hover state such as a background tint, and a distinct focus ring. Keep its size equal to the primary button next to it. If people still miss it, it is probably doing the wrong job.

Are ghost buttons bad for conversion?

Not when they are used for secondary actions. They only hurt when they carry the main action, because low visual weight means fewer people notice them. Make the thing you want clicked most the filled button, every time.

What is the CSS for a ghost button?

Set `background: transparent`, add `border: 1px solid` in a semi-transparent colour, and keep the text colour matching the border. Then add a `:hover` background tint and a `:focus-visible` outline so it works with mouse and keyboard.

People also ask

More quick answers

Ghost button vs pill button: are they the same thing?

No. A ghost button is about fill and weight, a pill button is about shape. You can have a ghost pill, a filled pill, a ghost rectangle, and so on.

Can a ghost button be accessible?

Yes, if the text hits 4.5:1 contrast, the border reaches about 3:1 against its surroundings, the target is large enough, and the focus state is visible. Over images, add a dark overlay or blur.

Do ghost buttons work on dark backgrounds?

They work well there, since a light hairline border and light text stand out clearly. Just raise the border opacity compared with the light-mode version.

Is a ghost button the same as a text link?

Not quite. A ghost button has padding, a defined shape and usually a border, so it reads as a button. A text link is lighter and belongs inside copy or as a tertiary action.

Why do ghost buttons use hairline borders?

A thin, low-opacity border defines the shape without adding visual weight, which keeps the button clearly secondary. It is the same logic behind hairline dividers and cards.

07 · Related terms
Free and open source

Found this useful? A GitHub star helps other designers find it.

Star on GitHub