Tilt Button

Tilt Button

A 3D button that tilts in perspective toward the cursor with a spring snap on press.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/tilt-button.json

▸ Or install manually

  1. Install dependencies: pnpm add motion
  2. Copy the source from the Code tab above.
  3. Place it at components/mellow/tilt-button.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
childrenReact.ReactNodeButton label content.
variant"default" | "accent""default"Color scheme — default is neutral glass, accent is blue.
maxTiltnumber12Maximum tilt angle in degrees.
perspectivenumber700CSS perspective distance in pixels.
classNamestringAdditional CSS classes.