React Native
jiggicons-react-native: icons with motion and sound in iOS and Android apps.
npx expo install jiggicons-react-native react-native-svg expo-audioIcons are drawn with react-native-svg and work in Expo and in bare React Native apps, on iOS, Android and the web.
import 'jiggicons-react-native/expo-audio';
import { JiggIcon } from 'jiggicons-react-native';
export function Inbox() {
return <JiggIcon name="bell" variant="solid" size={32} color="#161617" sound title="Notifications" />;
}Tap the icon and it plays. Motion follows the system’s Reduce Motion setting.
Props
| Prop | Default | |
|---|---|---|
name | — | A free icon: bell, music-note-2… |
variant | 'outline' | outline, solid, duotone or glass. Styles |
size | 24 | Width and height in points |
color | '#000' | The icon’s colour. Glass keeps its own frosted greys |
trigger | 'press' | What plays it: press, hover (web and iPad pointer), mount or none |
sound | false | Play the icon’s spatial sound with its motion |
volume | 1 | Sound volume from 0 to 1 |
title | — | Accessible name. Leave it out when the icon sits next to a visible label. Accessibility |
A ref gives you play() and stop(), for an icon that plays when something else happens:
const gift = useRef(null);
<JiggIcon ref={gift} name="gift" trigger="none" size={40} />
<Button title="Open" onPress={() => gift.current.play()} />Bundle size
<JiggIcon name> includes all 80 free icons and their sounds, about 0.8 MB of icon data and 1.4 MB of audio. To include only what you use, import icons one by one:
import Bell from 'jiggicons-react-native/icons/bell';
<Bell variant="duotone" sound />Sound
Each sound is made by the same synthesis as on the web, already placed between the two speakers along the path the icon moves, and ships as a small .m4a file. Importing jiggicons-react-native/expo-audio plays them with expo-audio: they mix with music and stay quiet when an iPhone is set to silent. To use another audio library, pass a player:
import { setSoundPlayer, setVolume } from 'jiggicons-react-native';
setSoundPlayer({
play(source, { volume }) {
// play the asset (what require('x.m4a') returns) at this volume
},
});
setVolume(0.6);Icons from the full set
npx jiggicons add shopping-bag --format jsThe CLI writes the icon’s data. Pass it to JiggIcon and it draws and moves like the free icons:
import { JiggIcon } from 'jiggicons-react-native';
import shoppingBag from './jiggicons/shopping-bag';
<JiggIcon icon={shoppingBag} variant="glass" />Sounds for icons from the full set aren’t bundled in React Native yet; those icons play their motion without sound.