react-fav
v1.0.9
Published
A cute animated favorite button for React π
Downloads
36
Maintainers
Readme
π react-fav
A cute, animated favorite button for React apps.
Add a fun, GSAP-powered favorite (like/heart) button to your blog, portfolio, or product with a single import. Supports persistent counts via optional backend API.
β¨ Features
- π Animated SVG orange button
- β‘ Smooth GSAP animations
- π’ Shows favorite count (with optional backend)
- πͺΆ Lightweight and tree-shakable
- π οΈ Zero-config, works out of the box
- π₯οΈ SSR/Next.js/Vercel-friendly
- π¦ TypeScript support
π¦ Installation
npm install react-fav
# or
pnpm add react-fav
# or
yarn add react-favπ Usage
import { Orange } from "react-fav";
import "react-fav/dist/Orange.css";
export default function App() {
return <Orange />;
}βοΈ How It Works
- Click the orange to "favorite".
- The orange animates and fills up as you click.
- Favorite count is fetched from
/api/favorites/[domain](see below). - No props required. Just drop in
<Orange />.
π License
MIT License Β© 2025 Dzung Vu
π Credits
- GSAP for animation
- Upstash Redis for backend example
