ThatDesignUIOriginalInteractive preview
3D keycap button
A chunky mechanical-keyboard key that physically sinks into its side wall when pressed, with a counter underneath.
- Category
- Buttons
- Platform
- Responsive
Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Default state
Use this component
Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.
FreeReact 18+Tailwind v3.4 or v4No extra packages
1. Add it with the shadcn CLI
npx shadcn@latest add https://www.thatdesignui.com/r/keycap-button.json2. Use it
Every prop is optionalapp/page.tsx
import KeycapButton from "@/components/keycap-button";
export default function Page() {
return <KeycapButton />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A 160 by 96px key: a dished off-white top (radial highlight, thin white edge) sitting on a 10px taupe side wall, with a soft shadow below, on a warm grey panel.
- The top shows a small grey shortcut hint at the top left and a bold 22px label at the bottom left.
- Pressing sinks the top 8px into the wall; a line under the key counts the presses.
How it behaves
- Pointer, Enter and Space all press it.
- The press count is announced.
- Focus shows a dark ring around the whole key.
- Disabled is faded and doesn't sink.



