5-Tier Tactile CompressionReact + Framer Motion

Smash Tactile Haptic Button

Multi-tier tactile compression button featuring porcelain cushion trays, dot-matrix arrays, internal optical flare beam, and deep haptic depression.

preview.tsx
Interactions:0
Hover or click to interact

Customizer

PRESETS & VARIATIONS

All Variants Preview

Hover & click to trigger neo-brutalist mechanical smash depression

Figma Neo-Brutalistvariant="figma"
1:1 Figma Master design with porcelain enclosure tray & dot matrix
UI Pirate Magmavariant="orange"
Signature magma orange reactor glow with dark obsidian core
Dark Obsidian Corevariant="dark"
Stealth midnight enclosure with crisp white chamfer bevels
Cyberpunk Violetvariant="cyberpunk"
High-voltage ultraviolet illumination with matrix array

Installation & Setup

Install required peer dependencies:

npm install framer-motion clsx

Code & Integration

SmashTactileButton.tsx• Production Ready
"use client";

import React, { useState } from "react";
import { motion } from "framer-motion";

export type SmashButtonVariant = "figma" | "dark" | "orange" | "cyberpunk";

export interface SmashTactileButtonProps {
  label?: string;
  variant?: SmashButtonVariant;
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "hero";
  onClick?: () => void;
  className?: string;
  disabled?: boolean;
}

export function SmashTactileButton({
  label = "Smash the button",
  variant = "figma",
  size = "md",
  onClick,
  className = "",
  disabled = false,
}: SmashTactileButtonProps) {
  const [isPressed, setIsPressed] = useState(false);
  const [isHovered, setIsHovered] = useState(false);

  return (
    <div
      className={`relative inline-block select-none p-3 rounded-[30px] bg-white/65 border border-[#CEC9F1] shadow-2xl ${className}`}
      onMouseEnter={() => setIsHovered(true)}
      onMouseLeave={() => {
        setIsHovered(false);
        setIsPressed(false);
      }}
    >
      <div className="relative p-2 rounded-[24px] bg-[#F3F3FE] shadow-[inset_0_1px_0_white,inset_0_-3px_0_#DFDEFB]">
        <motion.button
          type="button"
          disabled={disabled}
          onClick={onClick}
          onMouseDown={() => setIsPressed(true)}
          onMouseUp={() => setIsPressed(false)}
          animate={{
            y: isPressed ? 3 : isHovered ? -2 : 0,
            scale: isPressed ? 0.98 : 1,
          }}
          transition={{ type: "spring", stiffness: 500, damping: 22 }}
          className="relative px-10 py-4 rounded-[20px] bg-gradient-to-br from-[#1C182F] via-[#161326] to-[#0E0C18] text-white font-bold text-sm tracking-wide cursor-pointer focus:outline-none shadow-xl"
        >
          <span>{label}</span>
        </motion.button>
      </div>
    </div>
  );
}

export default SmashTactileButton;

Component API Reference

PropTypeDefaultDescription
labelstring"Smash the button"Text displayed on the central core cap
variantSmashButtonVariant"figma"Color scheme theme preset
size"xs" | "sm" | "md" | "lg" | "xl" | "hero""md"Scale multiplier
onClick() => voidundefinedClick callback event handler

Personalized Help

Struggling with tactile smash buttons or haptic micro-interactions? Let's talk about your product.

UI Pirate is a product design & development agency trusted by 50+ SaaS founders and enterprise teams across the US, UK & beyond. Tell us what you need.