This library allows you to easily integrate the playback of Lordicon icons into a React application. This library provides built-in support for both web and native environments.
$ npm install @lordicon/react
Sample usage:
import { Player } from '@lordicon/react';
const ICON = require('./assets/lock.json');
export default function Sample() {
const playerRef = useRef<Player>(null);
const onPlayPress = () => {
playerRef.current?.playFromBeginning();
}
return (
<Player
ref={playerRef}
icon={ ICON }
/>
);
}