What is a pill button?
A pill button is a button with fully rounded ends, so its left and right sides form perfect semicircles no matter how tall it is.
Made ofA button with a fully rounded radius (border-radius: 9999px) and a solid or outlined fill.
border-radius: 9999pxpadding: 10px 20pxSquint at the call to action on a modern consumer website and there is a good chance it looks like a capsule. Smooth, rounded all the way, a bit like something you would find in a medicine cabinet. That is the pill button, and it has quietly become the default shape for friendly interfaces.
Technically it is very simple. You give a button a corner radius that is at least half its height. In CSS that usually means border-radius: 9999px, an absurdly large number that the browser clamps to the correct value, so the shape stays a true pill however much the label or padding changes. A plain rounded rectangle, by comparison, has a fixed radius such as 8px, and its corners remain corners.
Why does the shape feel the way it does? Sharp corners suggest edges, precision and utility. Fully rounded ends suggest softness, approachability and something you can press without worrying. A pill also reads as a single object rather than a box with text in it, which is why the same shape works for tags, filters, badges and toggles as well as buttons. That consistency is part of the appeal: one shape language for every small interactive thing.
Pill buttons became common in consumer products and marketing sites in the 2020s and are now a safe choice for hero buttons and calls to action. They sit particularly well with generous whitespace, soft typography and photographs. They are less happy in dense interfaces. In a table full of actions, long rows of pills take up more horizontal space, and the rounded ends make precise alignment of text feel slightly off. Developer tools, finance dashboards and admin screens often feel more correct with a 4 to 8px radius.
The most important rule is to choose a radius language and stay with it. A pill primary button next to a sharp-cornered secondary button looks like two different design systems arguing. If your inputs, cards and buttons all have different radii, the interface feels unresolved. Many teams solve this by deciding that everything interactive is a pill, and all containers use one modest radius.
Some practical habits:
- Give horizontal padding roughly one and a half to two times the vertical padding. Without it, the label crowds the curved ends.
- Keep the height consistent across variants, such as 36, 44 and 52px, so pills line up.
- Keep the focus ring following the same rounded shape, with enough offset to stay visible.
- Make sure the target size is at least 44px tall on touch screens.
- Be careful with very short labels. A pill with one word can look like a lozenge, which is fine, but a pill with two long lines of text looks odd.
- Do not use pill shapes for large content blocks. A fully rounded card often looks strange as soon as it gets tall.
For AI prompts, describe the whole button system. Ask for a primary pill in the brand color, a ghost pill with a hairline border for the secondary action, 44px height, 24px horizontal padding, and a clear hover and focus state. If you only ask for rounded buttons, you will often get a mix of 6px, 12px and 9999px radii in a single page.
- Marketing CTAs and hero buttons
- Consumer products and modern SaaS
- Soft, friendly brand directions
- Brutalist or hyper-utility UIs
- Dense forms, pills take more horizontal space
- +Use border-radius: 9999px or 999rem for true pill shape
- +Keep horizontal padding 1.5–2× the vertical padding
- −Don't mix pill primary with sharp secondary, pick a radius language
Pill Button: your questions, answered
What is a pill button?
A pill button is a button whose corners are rounded so fully that the left and right ends become semicircles. It is made in CSS with a very large border-radius, such as 9999px. The shape feels soft and friendly and is common on marketing sites and consumer apps.
How do you make a pill-shaped button in CSS?
Set border-radius to a very large value like 9999px, or to half the button's height. The huge value is clamped by the browser, so the ends stay perfectly semicircular even when padding or text size changes. Add horizontal padding of about one and a half to two times the vertical padding.
When should I use pill buttons?
Use them for friendly, consumer-facing and marketing contexts such as calls to action, filters and tags, where a soft shape suits the brand. They are less suited to dense dashboards and developer tools, where a smaller corner radius reads as more precise and saves space.
What is the difference between a pill button and a rounded rectangle?
A rounded rectangle uses a fixed corner radius, like 8px, so its corners stay corners and its shape changes slightly with height. A pill uses a radius equal to half its height, which makes the ends perfect semicircles and keeps the capsule shape at any size.
More quick answers
Are pill buttons accessible?
Yes, as long as contrast, focus rings and touch targets are handled well. Make sure the focus outline follows the rounded shape and the button is at least 44px tall on touch screens.
Are pill buttons still trendy?
They are less a trend than a default now. They are common enough that choosing something else, such as a small radius, can be a deliberate way to stand out.
Can I mix pill buttons with square corners?
You can, but do it on purpose. A common rule is pills for interactive controls and one moderate radius for containers. Random mixing looks accidental.
What should a secondary pill button look like?
A ghost style works well: transparent fill, a thin border or no border, same height and padding as the primary. That keeps hierarchy clear without changing the shape.
Do pill shapes work with glass effects?
Yes. Frosted pill buttons and chips are common in modern interfaces, though you should always check text contrast against the blurred backdrop behind them.
Found this useful? A GitHub star helps other designers find it.