3D Press Button

A chunky button with a hard shadow that presses down on click.

Tailwind CSS
<button class="px-6 py-3 rounded-xl bg-amber-400 text-slate-900 font-bold text-sm border-2 border-slate-900 shadow-[4px_4px_0_0_#0f172a] hover:shadow-[2px_2px_0_0_#0f172a] hover:translate-x-[2px] hover:translate-y-[2px] active:shadow-none active:translate-x-[4px] active:translate-y-[4px] transition-all duration-150">
  Press me
</button>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Mint

Fresh mint tone for playful products aimed at younger users.

Tailwind CSS

Mono

Strict black and white for brutalist layouts and zines.

Tailwind CSS

Pill

Fully rounded shape softens the hard shadow for friendlier interfaces.

Tailwind CSS

About this 3d press button

The 3D press button looks like a physical keycap: a solid face with a hard offset shadow that compresses when clicked. It is the neo-brutalist button style popular on playful brands, kids products, and retro-styled sites. The tactile feel makes it irresistible to click.

This 3d button css uses a 4px solid shadow (shadow-[4px_4px_0_0_#0f172a]) that shrinks to 2px on hover and disappears on active, while the button translates to match. The synchronized shadow-and-move creates the physical press illusion.

The style is loud by design. It suits bold, playful brands and looks out of place on minimal luxury sites. Use it for primary actions where you want maximum clickability, not for quiet secondary links.

Most buttons ask to be clicked with color and copy, but on playful interfaces, kids products, and games, that is not enough; young users and casual players respond to things that look physically pressable. The 3D press button borrows its metaphor from arcade cabinets and mechanical keyboards: a face sitting on a visible base, promising the small satisfaction of pushing something down. It turns a CTA into a toy, and toys get pressed.

The base is a hard offset shadow with zero blur: shadow-[4px_4px_0_0_#0f172a]. On hover the shadow shrinks to 2px while the button translates 2px down and right (hover:translate-x-[2px] hover:translate-y-[2px]); on active the shadow disappears and the button translates the full 4px, landing exactly where the base was. The border-2 border-slate-900 outlines the face so it stays readable against its own shadow. The synchronized numbers are the whole illusion: shadow and movement must match.

Go chunkier for arcade energy: a 6px shadow with matching 6px active translation feels like a big red button under a plastic dome. Tint the shadow toward the face color (an amber-400 face over an amber-900 shadow feels warmer and more designed than pure black). Try rounded-full for a gumball-machine look on playful brands, and keep duration-150 so the press stays snappy.

The mistake is slowing the transition down. A 500ms ease on a 3D press makes the button sink like it is moving through foam, and the tactile snap that makes the pattern delightful turns to mush. Users read slow motion on a button as lag, not luxury. Keep the press at 100 to 150 milliseconds: fast enough to feel mechanical, slow enough to see.

Where to use it

  • ✓ Playful SaaS brands
  • ✓ Kids and education products
  • ✓ Gaming interfaces
  • ✓ Retro-styled landing pages

Customization tips

Match the shadow color to a darker shade of the button background. Increase to 6px shadow for chunkier depth. The border-2 in dark color defines the edge; keep it.

Design notes

When to use

Use it where clickability is the whole point: playful SaaS brands, kids and education products, and gaming interfaces. The hard shadow that compresses on click feels like a physical keycap, which invites pressing. It is ideal for primary actions on bold, casual sites.

What to avoid

Do not use it on minimal or luxury sites where the chunky shadow clashes with refined typography. Do not use it for destructive actions like delete, the playful press feel sends the wrong signal for something serious.

Accessibility

The press effect is visual only, so the button still needs a clear accessible name and a visible focus indicator. Make sure the amber background keeps enough contrast with the dark text at small sizes.

Frequently asked questions

How does the 3D press effect work?

A hard offset box-shadow creates the depth. On hover/active, the shadow shrinks while the button translates by the same amount, simulating physical compression.

What style suits 3D buttons?

Neo-brutalism, playful, retro. They clash with minimal or luxury aesthetics. Match the button style to the brand personality.

Are 3D buttons accessible?

Yes, they are real buttons with clear affordance. Ensure the text contrast is sufficient and the active state is visible for keyboard users via focus-visible styles.

How do I make the 3D press animation faster or slower?

The timing lives in the transition-all duration-150 class. Drop to duration-100 for a snappier, more mechanical feel, or raise to duration-200 for something softer. The shadow and the translate share the same transition, so they stay synchronized and the press illusion never breaks apart.

Why does my 3D button shadow look separated from the button?

The shadow offset and the translate amounts must match. If the shadow is 4px but the button only moves 2px on active, a gap appears and the illusion breaks. This element pairs a 4px shadow with a 4px translate on active, and 2px with 2px on hover, which keeps the face glued to the shadow.

Can I use a 3D press button for a delete or cancel action?

Better not to. The chunky press effect feels playful and inviting, which sends the wrong signal for something serious like delete. Reserve the 3D press style for positive, fun actions and use a plain or outline style for destructive or quiet secondary actions.

Customize it with our tools