rn-iconify 2.0.0 → 2.1.0

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.
Files changed (253) hide show
  1. package/README.md +8 -2
  2. package/assets/logo.gif +0 -0
  3. package/lib/commonjs/IconRenderer.js +56 -20
  4. package/lib/commonjs/IconRenderer.js.map +1 -1
  5. package/lib/commonjs/alias/Icon.js +35 -1
  6. package/lib/commonjs/alias/Icon.js.map +1 -1
  7. package/lib/commonjs/babel/cache-writer.js +1 -1
  8. package/lib/commonjs/babel/cache-writer.js.map +1 -1
  9. package/lib/commonjs/babel/index.js +0 -1
  10. package/lib/commonjs/babel/index.js.map +1 -1
  11. package/lib/commonjs/createIconSet.js +20 -1
  12. package/lib/commonjs/createIconSet.js.map +1 -1
  13. package/lib/module/IconRenderer.js +57 -19
  14. package/lib/module/IconRenderer.js.map +1 -1
  15. package/lib/module/alias/Icon.js +35 -1
  16. package/lib/module/alias/Icon.js.map +1 -1
  17. package/lib/module/babel/cache-writer.js +1 -1
  18. package/lib/module/babel/cache-writer.js.map +1 -1
  19. package/lib/module/babel/index.js +0 -1
  20. package/lib/module/babel/index.js.map +1 -1
  21. package/lib/module/createIconSet.js +20 -1
  22. package/lib/module/createIconSet.js.map +1 -1
  23. package/lib/typescript/IconRenderer.d.ts +1 -1
  24. package/lib/typescript/IconRenderer.d.ts.map +1 -1
  25. package/lib/typescript/alias/Icon.d.ts +1 -1
  26. package/lib/typescript/alias/Icon.d.ts.map +1 -1
  27. package/lib/typescript/babel/index.d.ts +0 -1
  28. package/lib/typescript/babel/index.d.ts.map +1 -1
  29. package/lib/typescript/babel/types.d.ts +1 -1
  30. package/lib/typescript/components/Academicons.d.ts +1 -1
  31. package/lib/typescript/components/AkarIcons.d.ts +1 -1
  32. package/lib/typescript/components/AntDesign.d.ts +1 -1
  33. package/lib/typescript/components/Arcticons.d.ts +1 -1
  34. package/lib/typescript/components/Basil.d.ts +1 -1
  35. package/lib/typescript/components/Bi.d.ts +1 -1
  36. package/lib/typescript/components/BitcoinIcons.d.ts +1 -1
  37. package/lib/typescript/components/Bpmn.d.ts +1 -1
  38. package/lib/typescript/components/Brandico.d.ts +1 -1
  39. package/lib/typescript/components/Bx.d.ts +1 -1
  40. package/lib/typescript/components/Bxl.d.ts +1 -1
  41. package/lib/typescript/components/Bxs.d.ts +1 -1
  42. package/lib/typescript/components/Bytesize.d.ts +1 -1
  43. package/lib/typescript/components/Carbon.d.ts +1 -1
  44. package/lib/typescript/components/Catppuccin.d.ts +1 -1
  45. package/lib/typescript/components/Cbi.d.ts +1 -1
  46. package/lib/typescript/components/Charm.d.ts +1 -1
  47. package/lib/typescript/components/Ci.d.ts +1 -1
  48. package/lib/typescript/components/Cib.d.ts +1 -1
  49. package/lib/typescript/components/Cif.d.ts +1 -1
  50. package/lib/typescript/components/Cil.d.ts +1 -1
  51. package/lib/typescript/components/CircleFlags.d.ts +1 -1
  52. package/lib/typescript/components/Circum.d.ts +1 -1
  53. package/lib/typescript/components/Clarity.d.ts +1 -1
  54. package/lib/typescript/components/Codex.d.ts +1 -1
  55. package/lib/typescript/components/Codicon.d.ts +1 -1
  56. package/lib/typescript/components/Covid.d.ts +1 -1
  57. package/lib/typescript/components/Cryptocurrency.d.ts +1 -1
  58. package/lib/typescript/components/CryptocurrencyColor.d.ts +1 -1
  59. package/lib/typescript/components/Cuida.d.ts +1 -1
  60. package/lib/typescript/components/Dashicons.d.ts +1 -1
  61. package/lib/typescript/components/Devicon.d.ts +1 -1
  62. package/lib/typescript/components/DeviconPlain.d.ts +1 -1
  63. package/lib/typescript/components/DinkieIcons.d.ts +1 -1
  64. package/lib/typescript/components/DuoIcons.d.ts +1 -1
  65. package/lib/typescript/components/Ei.d.ts +1 -1
  66. package/lib/typescript/components/El.d.ts +1 -1
  67. package/lib/typescript/components/EmojioneMonotone.d.ts +1 -1
  68. package/lib/typescript/components/Entypo.d.ts +1 -1
  69. package/lib/typescript/components/EntypoSocial.d.ts +1 -1
  70. package/lib/typescript/components/EosIcons.d.ts +1 -1
  71. package/lib/typescript/components/Ep.d.ts +1 -1
  72. package/lib/typescript/components/Et.d.ts +1 -1
  73. package/lib/typescript/components/Eva.d.ts +1 -1
  74. package/lib/typescript/components/F7.d.ts +1 -1
  75. package/lib/typescript/components/Fa.d.ts +1 -1
  76. package/lib/typescript/components/Fa6Brands.d.ts +1 -1
  77. package/lib/typescript/components/Fa6Regular.d.ts +1 -1
  78. package/lib/typescript/components/Fa6Solid.d.ts +1 -1
  79. package/lib/typescript/components/Fa7Brands.d.ts +1 -1
  80. package/lib/typescript/components/Fa7Regular.d.ts +1 -1
  81. package/lib/typescript/components/Fa7Solid.d.ts +1 -1
  82. package/lib/typescript/components/FaBrands.d.ts +1 -1
  83. package/lib/typescript/components/FaRegular.d.ts +1 -1
  84. package/lib/typescript/components/FaSolid.d.ts +1 -1
  85. package/lib/typescript/components/Fad.d.ts +1 -1
  86. package/lib/typescript/components/Famicons.d.ts +1 -1
  87. package/lib/typescript/components/Fe.d.ts +1 -1
  88. package/lib/typescript/components/Feather.d.ts +1 -1
  89. package/lib/typescript/components/FileIcons.d.ts +1 -1
  90. package/lib/typescript/components/Flag.d.ts +1 -1
  91. package/lib/typescript/components/Flagpack.d.ts +1 -1
  92. package/lib/typescript/components/FlatUi.d.ts +1 -1
  93. package/lib/typescript/components/Flowbite.d.ts +1 -1
  94. package/lib/typescript/components/Fluent.d.ts +1 -1
  95. package/lib/typescript/components/FluentColor.d.ts +1 -1
  96. package/lib/typescript/components/FluentEmoji.d.ts +1 -1
  97. package/lib/typescript/components/FluentEmojiFlat.d.ts +1 -1
  98. package/lib/typescript/components/FluentEmojiHighContrast.d.ts +1 -1
  99. package/lib/typescript/components/FluentMdl2.d.ts +1 -1
  100. package/lib/typescript/components/Fontelico.d.ts +1 -1
  101. package/lib/typescript/components/Fontisto.d.ts +1 -1
  102. package/lib/typescript/components/Formkit.d.ts +1 -1
  103. package/lib/typescript/components/Foundation.d.ts +1 -1
  104. package/lib/typescript/components/Gala.d.ts +1 -1
  105. package/lib/typescript/components/GameIcons.d.ts +1 -1
  106. package/lib/typescript/components/Garden.d.ts +1 -1
  107. package/lib/typescript/components/Geo.d.ts +1 -1
  108. package/lib/typescript/components/Gg.d.ts +1 -1
  109. package/lib/typescript/components/Gis.d.ts +1 -1
  110. package/lib/typescript/components/GravityUi.d.ts +1 -1
  111. package/lib/typescript/components/Gridicons.d.ts +1 -1
  112. package/lib/typescript/components/GrommetIcons.d.ts +1 -1
  113. package/lib/typescript/components/Guidance.d.ts +1 -1
  114. package/lib/typescript/components/Healthicons.d.ts +1 -1
  115. package/lib/typescript/components/Heroicons.d.ts +1 -1
  116. package/lib/typescript/components/HeroiconsOutline.d.ts +1 -1
  117. package/lib/typescript/components/HeroiconsSolid.d.ts +1 -1
  118. package/lib/typescript/components/Hugeicons.d.ts +1 -1
  119. package/lib/typescript/components/Humbleicons.d.ts +1 -1
  120. package/lib/typescript/components/Ic.d.ts +1 -1
  121. package/lib/typescript/components/IcomoonFree.d.ts +1 -1
  122. package/lib/typescript/components/IconPark.d.ts +1 -1
  123. package/lib/typescript/components/IconParkOutline.d.ts +1 -1
  124. package/lib/typescript/components/IconParkSolid.d.ts +1 -1
  125. package/lib/typescript/components/IconParkTwotone.d.ts +1 -1
  126. package/lib/typescript/components/Iconamoon.d.ts +1 -1
  127. package/lib/typescript/components/Iconoir.d.ts +1 -1
  128. package/lib/typescript/components/Icons8.d.ts +1 -1
  129. package/lib/typescript/components/Il.d.ts +1 -1
  130. package/lib/typescript/components/Ion.d.ts +1 -1
  131. package/lib/typescript/components/Iwwa.d.ts +1 -1
  132. package/lib/typescript/components/Ix.d.ts +1 -1
  133. package/lib/typescript/components/Jam.d.ts +1 -1
  134. package/lib/typescript/components/La.d.ts +1 -1
  135. package/lib/typescript/components/LetsIcons.d.ts +1 -1
  136. package/lib/typescript/components/LineMd.d.ts +1 -1
  137. package/lib/typescript/components/Lineicons.d.ts +1 -1
  138. package/lib/typescript/components/Logos.d.ts +1 -1
  139. package/lib/typescript/components/Ls.d.ts +1 -1
  140. package/lib/typescript/components/Lsicon.d.ts +1 -1
  141. package/lib/typescript/components/Lucide.d.ts +1 -1
  142. package/lib/typescript/components/LucideLab.d.ts +1 -1
  143. package/lib/typescript/components/Mage.d.ts +1 -1
  144. package/lib/typescript/components/Majesticons.d.ts +1 -1
  145. package/lib/typescript/components/Maki.d.ts +1 -1
  146. package/lib/typescript/components/Map.d.ts +1 -1
  147. package/lib/typescript/components/Marketeq.d.ts +1 -1
  148. package/lib/typescript/components/MaterialIconTheme.d.ts +1 -1
  149. package/lib/typescript/components/MaterialSymbols.d.ts +1 -1
  150. package/lib/typescript/components/MaterialSymbolsLight.d.ts +1 -1
  151. package/lib/typescript/components/Mdi.d.ts +1 -1
  152. package/lib/typescript/components/MdiLight.d.ts +1 -1
  153. package/lib/typescript/components/MedicalIcon.d.ts +1 -1
  154. package/lib/typescript/components/Memory.d.ts +1 -1
  155. package/lib/typescript/components/Meteocons.d.ts +1 -1
  156. package/lib/typescript/components/MeteorIcons.d.ts +1 -1
  157. package/lib/typescript/components/Mi.d.ts +1 -1
  158. package/lib/typescript/components/Mingcute.d.ts +1 -1
  159. package/lib/typescript/components/MonoIcons.d.ts +1 -1
  160. package/lib/typescript/components/Mynaui.d.ts +1 -1
  161. package/lib/typescript/components/Nimbus.d.ts +1 -1
  162. package/lib/typescript/components/Nonicons.d.ts +1 -1
  163. package/lib/typescript/components/Nrk.d.ts +1 -1
  164. package/lib/typescript/components/Octicon.d.ts +1 -1
  165. package/lib/typescript/components/Oi.d.ts +1 -1
  166. package/lib/typescript/components/Ooui.d.ts +1 -1
  167. package/lib/typescript/components/Oui.d.ts +1 -1
  168. package/lib/typescript/components/Pajamas.d.ts +1 -1
  169. package/lib/typescript/components/Pepicons.d.ts +1 -1
  170. package/lib/typescript/components/PepiconsPencil.d.ts +1 -1
  171. package/lib/typescript/components/PepiconsPop.d.ts +1 -1
  172. package/lib/typescript/components/PepiconsPrint.d.ts +1 -1
  173. package/lib/typescript/components/Ph.d.ts +1 -1
  174. package/lib/typescript/components/Picon.d.ts +1 -1
  175. package/lib/typescript/components/Pixel.d.ts +1 -1
  176. package/lib/typescript/components/Pixelarticons.d.ts +1 -1
  177. package/lib/typescript/components/Prime.d.ts +1 -1
  178. package/lib/typescript/components/Proicons.d.ts +1 -1
  179. package/lib/typescript/components/Ps.d.ts +1 -1
  180. package/lib/typescript/components/QlementineIcons.d.ts +1 -1
  181. package/lib/typescript/components/Quill.d.ts +1 -1
  182. package/lib/typescript/components/RadixIcons.d.ts +1 -1
  183. package/lib/typescript/components/Raphael.d.ts +1 -1
  184. package/lib/typescript/components/Ri.d.ts +1 -1
  185. package/lib/typescript/components/RivetIcons.d.ts +1 -1
  186. package/lib/typescript/components/Roentgen.d.ts +1 -1
  187. package/lib/typescript/components/Si.d.ts +1 -1
  188. package/lib/typescript/components/SiGlyph.d.ts +1 -1
  189. package/lib/typescript/components/Sidekickicons.d.ts +1 -1
  190. package/lib/typescript/components/SimpleIcons.d.ts +1 -1
  191. package/lib/typescript/components/SimpleLineIcons.d.ts +1 -1
  192. package/lib/typescript/components/SkillIcons.d.ts +1 -1
  193. package/lib/typescript/components/Solar.d.ts +1 -1
  194. package/lib/typescript/components/Stash.d.ts +1 -1
  195. package/lib/typescript/components/Streamline.d.ts +1 -1
  196. package/lib/typescript/components/StreamlineBlock.d.ts +1 -1
  197. package/lib/typescript/components/StreamlineColor.d.ts +1 -1
  198. package/lib/typescript/components/StreamlineCyber.d.ts +1 -1
  199. package/lib/typescript/components/StreamlineCyberColor.d.ts +1 -1
  200. package/lib/typescript/components/StreamlineEmojis.d.ts +1 -1
  201. package/lib/typescript/components/StreamlineFlex.d.ts +1 -1
  202. package/lib/typescript/components/StreamlineFlexColor.d.ts +1 -1
  203. package/lib/typescript/components/StreamlineFreehand.d.ts +1 -1
  204. package/lib/typescript/components/StreamlineFreehandColor.d.ts +1 -1
  205. package/lib/typescript/components/StreamlineKameleonColor.d.ts +1 -1
  206. package/lib/typescript/components/StreamlineLogos.d.ts +1 -1
  207. package/lib/typescript/components/StreamlinePixel.d.ts +1 -1
  208. package/lib/typescript/components/StreamlinePlump.d.ts +1 -1
  209. package/lib/typescript/components/StreamlinePlumpColor.d.ts +1 -1
  210. package/lib/typescript/components/StreamlineSharp.d.ts +1 -1
  211. package/lib/typescript/components/StreamlineSharpColor.d.ts +1 -1
  212. package/lib/typescript/components/StreamlineStickiesColor.d.ts +1 -1
  213. package/lib/typescript/components/StreamlineUltimate.d.ts +1 -1
  214. package/lib/typescript/components/StreamlineUltimateColor.d.ts +1 -1
  215. package/lib/typescript/components/Subway.d.ts +1 -1
  216. package/lib/typescript/components/SvgSpinners.d.ts +1 -1
  217. package/lib/typescript/components/SystemUicons.d.ts +1 -1
  218. package/lib/typescript/components/Tabler.d.ts +1 -1
  219. package/lib/typescript/components/Tdesign.d.ts +1 -1
  220. package/lib/typescript/components/Teenyicons.d.ts +1 -1
  221. package/lib/typescript/components/Temaki.d.ts +1 -1
  222. package/lib/typescript/components/Token.d.ts +1 -1
  223. package/lib/typescript/components/TokenBranded.d.ts +1 -1
  224. package/lib/typescript/components/Topcoat.d.ts +1 -1
  225. package/lib/typescript/components/Typcn.d.ts +1 -1
  226. package/lib/typescript/components/Uil.d.ts +1 -1
  227. package/lib/typescript/components/Uim.d.ts +1 -1
  228. package/lib/typescript/components/Uis.d.ts +1 -1
  229. package/lib/typescript/components/Uit.d.ts +1 -1
  230. package/lib/typescript/components/Uiw.d.ts +1 -1
  231. package/lib/typescript/components/Unjs.d.ts +1 -1
  232. package/lib/typescript/components/Vaadin.d.ts +1 -1
  233. package/lib/typescript/components/Vs.d.ts +1 -1
  234. package/lib/typescript/components/VscodeIcons.d.ts +1 -1
  235. package/lib/typescript/components/Websymbol.d.ts +1 -1
  236. package/lib/typescript/components/Weui.d.ts +1 -1
  237. package/lib/typescript/components/Whh.d.ts +1 -1
  238. package/lib/typescript/components/Wi.d.ts +1 -1
  239. package/lib/typescript/components/Wpf.d.ts +1 -1
  240. package/lib/typescript/components/Zmdi.d.ts +1 -1
  241. package/lib/typescript/components/Zondicons.d.ts +1 -1
  242. package/lib/typescript/createIconSet.d.ts +1 -1
  243. package/lib/typescript/createIconSet.d.ts.map +1 -1
  244. package/lib/typescript/types/index.d.ts +56 -0
  245. package/lib/typescript/types/index.d.ts.map +1 -1
  246. package/package.json +3 -1
  247. package/src/IconRenderer.tsx +51 -8
  248. package/src/alias/Icon.tsx +32 -0
  249. package/src/babel/cache-writer.ts +1 -1
  250. package/src/babel/index.ts +0 -1
  251. package/src/babel/types.ts +1 -1
  252. package/src/createIconSet.tsx +17 -0
  253. package/src/types/index.ts +75 -0
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
7
- import { View, StyleSheet, Animated } from 'react-native';
7
+ import { View, StyleSheet, Animated, Pressable } from 'react-native';
8
8
  import { SvgXml } from 'react-native-svg';
9
9
  import { CacheManager } from './cache/CacheManager';
10
10
  import { fetchIcon } from './network/IconifyAPI';
@@ -32,6 +32,7 @@ export function IconRenderer({
32
32
  width: propWidth,
33
33
  height: propHeight,
34
34
  style,
35
+ className,
35
36
  rotate = 0,
36
37
  flip,
37
38
  fallback,
@@ -43,6 +44,13 @@ export function IconRenderer({
43
44
  onError,
44
45
  accessibilityLabel,
45
46
  testID,
47
+ // Press props
48
+ onPress,
49
+ onLongPress,
50
+ onPressIn,
51
+ onPressOut,
52
+ disabled,
53
+ pressedStyle,
46
54
  // Animation props
47
55
  animate,
48
56
  animationDuration,
@@ -186,15 +194,44 @@ export function IconRenderer({
186
194
  // Determine if we should show placeholder/fallback
187
195
  const shouldShowPlaceholder = (state === 'loading' && showFallback) || state === 'error';
188
196
 
197
+ // Check if icon should be pressable
198
+ const isPressable = !!(onPress || onLongPress);
199
+
200
+ // NativeWind className support - conditional spread to avoid TS errors
201
+ const nativeWindProps = className ? { className } : {};
202
+
203
+ /**
204
+ * Wraps content with Pressable if onPress/onLongPress is provided
205
+ */
206
+ const wrapWithPressable = (content: React.ReactNode) => {
207
+ if (!isPressable) return content;
208
+
209
+ return (
210
+ <Pressable
211
+ onPress={onPress}
212
+ onLongPress={onLongPress}
213
+ onPressIn={onPressIn}
214
+ onPressOut={onPressOut}
215
+ disabled={disabled}
216
+ accessibilityRole="button"
217
+ accessibilityState={{ disabled }}
218
+ style={({ pressed }) => [pressed && pressedStyle]}
219
+ >
220
+ {content}
221
+ </Pressable>
222
+ );
223
+ };
224
+
189
225
  // Render placeholder or fallback during loading/error
190
226
  if (shouldShowPlaceholder) {
191
227
  // Priority: placeholder > fallback
192
228
  if (placeholder !== undefined) {
193
- return (
229
+ return wrapWithPressable(
194
230
  <View
195
231
  style={[{ width: iconWidth, height: iconHeight }, style]}
196
232
  accessibilityLabel={accessibilityLabel}
197
233
  testID={testID}
234
+ {...nativeWindProps}
198
235
  >
199
236
  <PlaceholderFactory
200
237
  type={placeholder}
@@ -209,11 +246,12 @@ export function IconRenderer({
209
246
 
210
247
  // Fallback for backwards compatibility (deprecated)
211
248
  if (fallback) {
212
- return (
249
+ return wrapWithPressable(
213
250
  <View
214
251
  style={[{ width: iconWidth, height: iconHeight }, style]}
215
252
  accessibilityLabel={accessibilityLabel}
216
253
  testID={testID}
254
+ {...nativeWindProps}
217
255
  >
218
256
  {fallback}
219
257
  </View>
@@ -221,11 +259,12 @@ export function IconRenderer({
221
259
  }
222
260
 
223
261
  // Return empty view if no placeholder/fallback
224
- return (
262
+ return wrapWithPressable(
225
263
  <View
226
264
  style={[{ width: iconWidth, height: iconHeight }, style]}
227
265
  accessibilityLabel={accessibilityLabel}
228
266
  testID={testID}
267
+ {...nativeWindProps}
229
268
  />
230
269
  );
231
270
  }
@@ -234,7 +273,7 @@ export function IconRenderer({
234
273
  if (colorizedSvg) {
235
274
  // Render with animation wrapper if animation is enabled
236
275
  if (hasAnimation) {
237
- return (
276
+ return wrapWithPressable(
238
277
  <Animated.View
239
278
  style={[
240
279
  styles.container,
@@ -245,6 +284,7 @@ export function IconRenderer({
245
284
  accessibilityLabel={accessibilityLabel}
246
285
  accessibilityRole="image"
247
286
  testID={testID}
287
+ {...nativeWindProps}
248
288
  >
249
289
  <SvgXml xml={colorizedSvg} width={iconWidth} height={iconHeight} />
250
290
  </Animated.View>
@@ -252,7 +292,7 @@ export function IconRenderer({
252
292
  }
253
293
 
254
294
  // Render without animation
255
- return (
295
+ return wrapWithPressable(
256
296
  <View
257
297
  style={[
258
298
  styles.container,
@@ -262,6 +302,7 @@ export function IconRenderer({
262
302
  accessibilityLabel={accessibilityLabel}
263
303
  accessibilityRole="image"
264
304
  testID={testID}
305
+ {...nativeWindProps}
265
306
  >
266
307
  <SvgXml xml={colorizedSvg} width={iconWidth} height={iconHeight} />
267
308
  </View>
@@ -270,11 +311,12 @@ export function IconRenderer({
270
311
 
271
312
  // Show placeholder immediately if set (no delay), otherwise empty view
272
313
  if (placeholder !== undefined && state === 'loading') {
273
- return (
314
+ return wrapWithPressable(
274
315
  <View
275
316
  style={[{ width: iconWidth, height: iconHeight }, style]}
276
317
  accessibilityLabel={accessibilityLabel}
277
318
  testID={testID}
319
+ {...nativeWindProps}
278
320
  >
279
321
  <PlaceholderFactory
280
322
  type={placeholder}
@@ -288,11 +330,12 @@ export function IconRenderer({
288
330
  }
289
331
 
290
332
  // Return empty view while loading (before fallback delay)
291
- return (
333
+ return wrapWithPressable(
292
334
  <View
293
335
  style={[{ width: iconWidth, height: iconHeight }, style]}
294
336
  accessibilityLabel={accessibilityLabel}
295
337
  testID={testID}
338
+ {...nativeWindProps}
296
339
  />
297
340
  );
298
341
  }
@@ -43,6 +43,7 @@ export function Icon({
43
43
  width,
44
44
  height,
45
45
  style,
46
+ className,
46
47
  rotate,
47
48
  flip,
48
49
  fallback,
@@ -54,6 +55,21 @@ export function Icon({
54
55
  onError,
55
56
  accessibilityLabel,
56
57
  testID,
58
+ // Press props
59
+ onPress,
60
+ onLongPress,
61
+ onPressIn,
62
+ onPressOut,
63
+ disabled,
64
+ pressedStyle,
65
+ // Animation props
66
+ animate,
67
+ animationDuration,
68
+ animationLoop,
69
+ animationEasing,
70
+ animationDelay,
71
+ autoPlay,
72
+ onAnimationComplete,
57
73
  }: GenericIconProps) {
58
74
  // Get theme defaults
59
75
  const { theme } = useIconTheme();
@@ -93,6 +109,7 @@ export function Icon({
93
109
  width={width}
94
110
  height={height}
95
111
  style={style}
112
+ className={className}
96
113
  rotate={mergedRotate}
97
114
  flip={mergedFlip}
98
115
  fallback={fallback}
@@ -104,6 +121,21 @@ export function Icon({
104
121
  onError={onError}
105
122
  accessibilityLabel={accessibilityLabel ?? name}
106
123
  testID={testID}
124
+ // Press props
125
+ onPress={onPress}
126
+ onLongPress={onLongPress}
127
+ onPressIn={onPressIn}
128
+ onPressOut={onPressOut}
129
+ disabled={disabled}
130
+ pressedStyle={pressedStyle}
131
+ // Animation props
132
+ animate={animate}
133
+ animationDuration={animationDuration}
134
+ animationLoop={animationLoop}
135
+ animationEasing={animationEasing}
136
+ animationDelay={animationDelay}
137
+ autoPlay={autoPlay}
138
+ onAnimationComplete={onAnimationComplete}
107
139
  />
108
140
  );
109
141
  }
@@ -260,7 +260,7 @@ export async function generateBundle(
260
260
  options: BabelPluginOptions,
261
261
  projectRoot: string
262
262
  ): Promise<void> {
263
- const { outputPath = '.rn-iconify-cache', verbose = false } = options;
263
+ const { outputPath = 'node_modules/.cache/rn-iconify', verbose = false } = options;
264
264
 
265
265
  if (iconNames.length === 0) {
266
266
  if (verbose) {
@@ -21,7 +21,6 @@
21
21
  * ['rn-iconify/babel', {
22
22
  * include: ['mdi:*', 'heroicons:*'],
23
23
  * exclude: ['mdi:test-*'],
24
- * outputPath: '.rn-iconify-cache',
25
24
  * verbose: true,
26
25
  * }]
27
26
  * ],
@@ -24,7 +24,7 @@ export interface BabelPluginOptions {
24
24
 
25
25
  /**
26
26
  * Output directory for the generated cache
27
- * @default '.rn-iconify-cache'
27
+ * @default 'node_modules/.cache/rn-iconify'
28
28
  */
29
29
  outputPath?: string;
30
30
 
@@ -61,6 +61,7 @@ export function createIconSet<T extends string>(
61
61
  width,
62
62
  height,
63
63
  style,
64
+ className,
64
65
  rotate,
65
66
  flip,
66
67
  fallback,
@@ -72,6 +73,13 @@ export function createIconSet<T extends string>(
72
73
  onError,
73
74
  accessibilityLabel,
74
75
  testID,
76
+ // Press props
77
+ onPress,
78
+ onLongPress,
79
+ onPressIn,
80
+ onPressOut,
81
+ disabled,
82
+ pressedStyle,
75
83
  // Animation props
76
84
  animate,
77
85
  animationDuration,
@@ -117,6 +125,7 @@ export function createIconSet<T extends string>(
117
125
  width={width}
118
126
  height={height}
119
127
  style={style}
128
+ className={className}
120
129
  rotate={mergedRotate}
121
130
  flip={mergedFlip}
122
131
  fallback={fallback}
@@ -128,6 +137,14 @@ export function createIconSet<T extends string>(
128
137
  onError={onError}
129
138
  accessibilityLabel={accessibilityLabel ?? name}
130
139
  testID={testID}
140
+ // Press props
141
+ onPress={onPress}
142
+ onLongPress={onLongPress}
143
+ onPressIn={onPressIn}
144
+ onPressOut={onPressOut}
145
+ disabled={disabled}
146
+ pressedStyle={pressedStyle}
147
+ // Animation props
131
148
  animate={animate}
132
149
  animationDuration={animationDuration}
133
150
  animationLoop={animationLoop}
@@ -113,6 +113,81 @@ export interface IconProps<T extends string = string> {
113
113
  */
114
114
  testID?: string;
115
115
 
116
+ // ─────────────────────────────────────────────────────────────────
117
+ // Press/Touch Props
118
+ // ─────────────────────────────────────────────────────────────────
119
+
120
+ /**
121
+ * Called when the icon is pressed.
122
+ * When provided, the icon is automatically wrapped in a Pressable component.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * <Mdi name="close" onPress={() => console.log('pressed')} />
127
+ * ```
128
+ */
129
+ onPress?: () => void;
130
+
131
+ /**
132
+ * Called when the icon is long pressed.
133
+ * When provided (along with or without onPress), the icon is wrapped in Pressable.
134
+ */
135
+ onLongPress?: () => void;
136
+
137
+ /**
138
+ * Called when press starts (finger down).
139
+ */
140
+ onPressIn?: () => void;
141
+
142
+ /**
143
+ * Called when press ends (finger up).
144
+ */
145
+ onPressOut?: () => void;
146
+
147
+ /**
148
+ * Whether the icon press is disabled.
149
+ * Only applicable when onPress or onLongPress is provided.
150
+ * @default false
151
+ */
152
+ disabled?: boolean;
153
+
154
+ /**
155
+ * Style applied to the icon when pressed.
156
+ * Only applicable when onPress or onLongPress is provided.
157
+ * If not provided, no visual feedback is shown on press.
158
+ *
159
+ * @example
160
+ * ```tsx
161
+ * <Mdi
162
+ * name="settings"
163
+ * onPress={() => {}}
164
+ * pressedStyle={{ opacity: 0.5, transform: [{ scale: 0.95 }] }}
165
+ * />
166
+ * ```
167
+ */
168
+ pressedStyle?: StyleProp<ViewStyle>;
169
+
170
+ // ─────────────────────────────────────────────────────────────────
171
+ // NativeWind Support
172
+ // ─────────────────────────────────────────────────────────────────
173
+
174
+ /**
175
+ * NativeWind/Tailwind CSS class names for styling.
176
+ * Only works in projects with NativeWind configured.
177
+ *
178
+ * @example
179
+ * ```tsx
180
+ * <Mdi name="home" className="w-6 h-6 text-blue-500" />
181
+ * ```
182
+ *
183
+ * @see https://www.nativewind.dev/
184
+ */
185
+ className?: string;
186
+
187
+ // ─────────────────────────────────────────────────────────────────
188
+ // Animation Props
189
+ // ─────────────────────────────────────────────────────────────────
190
+
116
191
  /**
117
192
  * Animation to apply to the icon
118
193
  * Can be a preset ('spin', 'pulse', 'bounce', 'shake', 'ping', 'wiggle')