Skip to main content

Installation

Prerequisites

  • Node.js version 18 or later
  • An SVG element in your HTML page

Adding Japit to your project

To install Japit, you can use the package manager of your choice:

npm install japit

Japit ships with TypeScript type definitions, so no additional @types package is needed.

Setting up an SVG element

Japit animates SVG elements that already exist in your DOM. Add an <svg> element to your HTML:

<svg></svg>

Then, in your JavaScript or TypeScript code, query the element and set its dimensions:

const svg = document.querySelector('svg');
svg.style.width = '1000px';
svg.style.height = '500px';

You're now ready to create your first animation — head over to Your first animation.