Button 3D Press
A raised key with a real edge and cast shadow: it lifts slightly on hover, sinks hard on press and bounces back on release.
button3dpressdepthtactile
Installation
Run the shadcn CLI in a project with Tailwind CSS. The component lands in components/pixelpapa/button-3d-press.tsx.
$pnpm dlx shadcn@latest add "https://pixelpapa.com/r/button-3d-press.json"Manual install+
1. Install the dependencies.
$pnpm add lucide-react2. Copy the code from the Code tab above into your project. It imports the cn helper from @/lib/utils, which every shadcn project already has.
Build it with AI
Prefer to let an agent do the wiring? Copy this prompt, describe where the component should go, and paste.
AI prompt
Paste into Claude, Cursor, v0 or Lovable
Add the "Button 3D Press" component from PixelPapa UI to this project. What it is: A raised key with a real edge and cast shadow: it lifts slightly on hover, sinks hard on press and bounces back on release. Category: Buttons. Depends on: lucide-react. 1. Install it with the shadcn CLI: npx shadcn@latest add "https://pixelpapa.com/r/button-3d-press.json" (If the CLI is unavailable, fetch that URL, write files[0].content to components/pixelpapa/button-3d-press.tsx and install the listed dependencies.) 2. Import it from "@/components/pixelpapa/button-3d-press" and place it where I describe below. 3. Keep its animation timings and accessibility attributes. Replace the demo copy and data with content that fits my product, and use my existing theme tokens (bg-background, text-foreground, bg-primary, border-border) rather than hard-coded colours. Where to use it: <describe the page and position here>
More buttons
- Button Async StatesRuns a promise and morphs through idle, a collapsed spinner, then a success or error label, animating its width between each.
- Button Border BeamA comet of light laps the button's border on a loop, with a soft halo that follows the head of the beam.
- Button Confetti BurstThrows a fan of DOM confetti from the exact point you clicked; pieces arc up, tumble and fall under gravity. No canvas.
- Button Copy FeedbackCopies a value to the clipboard, then swaps its icon for a drawn check and rolls the label to "Copied" before settling back.
- Button Gradient Border GlowA flowing gradient outline with a blurred twin underneath; the glow brightens on hover and leans toward the cursor.
- Button Group SegmentedA segmented control whose pill stretches like jelly: its leading edge races ahead and the trailing edge catches up on a softer spring.