pop-emojis 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -60
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,73 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pop-emojis 🎉
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A tiny, opinionated React component that creates smooth emoji pop animations on click — built on top of Framer Motion.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Perfect for reactions, likes, feedback buttons, and fun micro-interactions with **zero animation setup**.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
7
|
+
---
|
|
9
8
|
|
|
10
|
-
##
|
|
9
|
+
## ✨ Features
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
- **One-line usage** — Add emoji pops in seconds
|
|
12
|
+
- **Built on Framer Motion** — Smooth, physics-based animations
|
|
13
|
+
- **Sensible defaults** — Works great out of the box
|
|
14
|
+
- 📦 **Zero boilerplate** — No animation code required
|
|
15
|
+
- 🔒 **Fully typed** — Complete TypeScript support
|
|
16
|
+
- ⚛️ **React 17+** — Compatible with modern React
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
---
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
## 📦 Installation
|
|
17
21
|
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
```bash
|
|
23
|
+
npm install pop-emojis framer-motion
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> **Note:** `framer-motion` is a peer dependency and must be installed separately.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🚀 Usage
|
|
31
|
+
|
|
32
|
+
### Basic Example
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { EmojiPop } from "pop-emojis"
|
|
36
|
+
|
|
37
|
+
export default function App() {
|
|
38
|
+
return (
|
|
39
|
+
<div style={{ display: "flex", justifyContent: "center", marginTop: 100 }}>
|
|
40
|
+
<EmojiPop emoji="🫡" />
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**What happens?**
|
|
25
47
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
tseslint.configs.strictTypeChecked,
|
|
30
|
-
// Optionally, add this for stylistic rules
|
|
31
|
-
tseslint.configs.stylisticTypeChecked,
|
|
48
|
+
1. You see 🫡
|
|
49
|
+
2. You click 🫡
|
|
50
|
+
3. Multiple 🫡 emojis pop out with smooth animations
|
|
32
51
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
-
tsconfigRootDir: import.meta.dirname,
|
|
39
|
-
},
|
|
40
|
-
// other options...
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
])
|
|
52
|
+
### Custom Count
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<EmojiPop emoji="❤️" count={10} />
|
|
44
56
|
```
|
|
45
57
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
files: ['**/*.{ts,tsx}'],
|
|
57
|
-
extends: [
|
|
58
|
-
// Other configs...
|
|
59
|
-
// Enable lint rules for React
|
|
60
|
-
reactX.configs['recommended-typescript'],
|
|
61
|
-
// Enable lint rules for React DOM
|
|
62
|
-
reactDom.configs.recommended,
|
|
63
|
-
],
|
|
64
|
-
languageOptions: {
|
|
65
|
-
parserOptions: {
|
|
66
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
-
tsconfigRootDir: import.meta.dirname,
|
|
68
|
-
},
|
|
69
|
-
// other options...
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
])
|
|
58
|
+
### Different Emojis
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
<div style={{ display: "flex", gap: "1rem" }}>
|
|
62
|
+
<EmojiPop emoji="🎉" />
|
|
63
|
+
<EmojiPop emoji="👍" />
|
|
64
|
+
<EmojiPop emoji="🔥" />
|
|
65
|
+
<EmojiPop emoji="⭐" />
|
|
66
|
+
</div>
|
|
73
67
|
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## ⚙️ Props
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Default | Description |
|
|
74
|
+
|---------|----------|---------|----------------------------------------|
|
|
75
|
+
| `emoji` | `string` | `"🫡"` | Emoji used for both button & animation |
|
|
76
|
+
| `count` | `number` | `6` | Number of emojis per click |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🤔 Why This Library?
|
|
81
|
+
|
|
82
|
+
Yes, you can use Framer Motion directly.
|
|
83
|
+
|
|
84
|
+
This library exists to:
|
|
85
|
+
|
|
86
|
+
✅ **Remove repetitive animation code** — Don't write the same pop logic over and over
|
|
87
|
+
|
|
88
|
+
✅ **Provide a ready-made reaction interaction** — Common UX pattern, pre-built
|
|
89
|
+
|
|
90
|
+
✅ **Keep animation logic out of your app** — Focus on features, not micro-interactions
|
|
91
|
+
|
|
92
|
+
Think of it as a **pre-built micro-interaction**, not an animation engine.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 🤝 Contributing
|
|
99
|
+
|
|
100
|
+
Issues and pull requests are welcome! Feel free to open an issue if you find a bug or have a feature request.
|