blur-toggle-button
pixel-perfect/blur-toggle-buttonUnverifiedBlock
A button with blur transition effect on toggle using Framer Motion.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/DhruvitNavadiya/portfolio-new/main/blur-toggle-button.jsonSource
1"use client";2import React, { useState } from "react";3import { AnimatePresence, motion } from "framer-motion";4import { Check, Copy } from "lucide-react";56const BlurToggleButton = () => {7 const [checked, setChecked] = useState(false);89 return (10 <motion.button11 whileTap={{12 scale: 0.95,13 }}14 className="border p-3 rounded-md bg-background cursor-pointer"15 onClick={() => {16 setChecked(!checked);17 }}18 >19 <AnimatePresence mode="wait">20 {checked ? (21 <motion.div22 key="copy"23 initial={{ filter: "blur(1px)", scale: 1 }}24 animate={{ filter: "blur(0px)", scale: 1.2 }}25 exit={{ filter: "blur(1px)", scale: 0.8 }}26 transition={{ duration: 0.05 }}27 >28 <Copy size={16} />29 </motion.div>30 ) : (31 <motion.div32 key="check"33 initial={{ filter: "blur(1px)", scale: 1 }}34 animate={{ filter: "blur(0px)", scale: 1.2 }}35 exit={{ filter: "blur(1px)", scale: 0.8 }}36 transition={{ duration: 0.05 }}37 >38 <Check size={16} />39 </motion.div>40 )}41 </AnimatePresence>42 </motion.button>43 );44};4546export default BlurToggleButton;
What it pulls in
npm packages
Files it writes
More from pixel-perfect
All 60 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 3d-button3d-button | pixel-perfect | Blocks | Unverified | 2 deps | |
| abhinav-bento-buttonabhinav-bento-button | pixel-perfect | Blocks | Unverified | no deps | |
| accordion-carouselaccordion-carousel | pixel-perfect | Blocks | Free | 1 dep | |
| accordion-foldaccordion-fold | pixel-perfect | Blocks | Free | 1 dep | |
| activity-wheel-motionactivity-wheel-motion | pixel-perfect | Blocks | Free | 2 deps | |
| animated-textureanimated-texture | pixel-perfect | Blocks | Free | 1 dep | |
| aperture-mask-revealaperture-mask-reveal | pixel-perfect | Blocks | Free | 1 dep | |
| aurora-curtainaurora-curtain | pixel-perfect | Blocks | Free | no deps |
