Button with Tap Animation

PreviousNext

A button with tap animation component

Docs
shadcnui-blockscomponent

Preview

Loading preview…
components/customized/button/button-23.tsx
import { Button } from "@/registry/ui/button";
import * as motion from "framer-motion/client";
import { StarIcon } from "lucide-react";

const ButtonsWithTapAnimation = () => (
  <div className="flex items-center gap-2 flex-wrap">
    <Button asChild>
      <motion.button whileTap={{ scale: 0.85 }}>Tap</motion.button>
    </Button>
    <Button asChild size="icon">
      <motion.button whileTap={{ scale: 0.85 }}>
        <StarIcon />
      </motion.button>
    </Button>
    <Button asChild>
      <motion.button whileTap={{ scale: 0.85 }}>
        <StarIcon /> Star
      </motion.button>
    </Button>
  </div>
);

export default ButtonsWithTapAnimation;

Installation

npx shadcn@latest add @shadcnui-blocks/button-23

Usage

import { Button23 } from "@/components/button-23"
<Button23 />