@lordicon/react
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

React

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.

Installation

$ npm install @lordicon/react

Usage

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 }
    />
  );
}

More examples

For more code samples demonstrating various possibilities, please refer to the 'demo' folder.

Useful links

  • Lordicon - Lordicon is a powerful library of thousands of carefully crafted animated icons. element.
  • Lottie - Render After Effects animations natively on Web, Android and iOS, and React Native.

Package Sidebar

Install

npm i @lordicon/react

Weekly Downloads

1,035

Version

1.6.0

License

MIT

Unpacked Size

45.3 kB

Total Files

12

Last publish

Collaborators

  • baszczewski
  • willusz