npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

live2d-react

v0.2.0

Published

React component wrapper for Live2D Cubism models with user-supplied Core and assets.

Readme

live2d-react

live2d-react is a React wrapper around the Live2D Cubism Web Framework.

It is built for developers who want a React-native way to render Live2D models without wiring low-level Cubism runtime pieces by hand.

It currently targets the official Cubism SDK for Web 5 line used in this repo.

It is intentionally designed like a generic integration library, not an asset pack:

  • you provide your own live2dcubismcore.min.js
  • you provide your own model assets
  • this package provides the React component and the Cubism framework glue

Why live2d-react

  • React-first API Use a component instead of stitching model rendering into a custom canvas integration layer.
  • Less setup friction No external shader hosting step and no shader-path configuration.
  • Cubism 5-ready foundation Built around the official Cubism SDK for Web 5 generation used by this repo.
  • Cubism-focused Designed for apps that just need to render and interact with a Live2D model.
  • Small mental model Most users only need modelJsonPath and coreScriptSrc.
  • Good fit for app teams Especially useful when the rest of the product is already standard React UI.

Install

npm install live2d-react

Then:

  1. add live2dcubismcore.min.js to your app's public assets
  2. add your model folder to your app's public assets

Playground

This repo also includes a Vite playground app for trying hosted models and the render normalization controls.

  • npm run dev: run the local playground
  • npm run build:demo: build the playground as a static site

Usage

import { Live2D } from 'live2d-react';

export function Example() {
  return (
    <Live2D
      modelJsonPath="/models/Hiyori/Hiyori.model3.json"
      coreScriptSrc="/cubism/core/live2dcubismcore.min.js"
      style={{ width: 420, height: 420 }}
      renderOptions={{
        fitMode: 'height',
        anchorY: 'bottom'
      }}
    />
  );
}

Props

  • modelJsonPath: URL path to the model's .model3.json
  • coreScriptSrc: URL path to live2dcubismcore.min.js
  • idleMotionGroup: defaults to Idle
  • tapBodyMotionGroup: defaults to TapBody
  • headHitAreaName: defaults to Head
  • bodyHitAreaName: defaults to Body
  • renderOptions: optional render normalization controls

renderOptions supports:

  • fitMode: none, contain, cover, width, or height
  • anchorX: left, center, or right
  • anchorY: top, center, or bottom
  • offsetX / offsetY: extra logical-scene offsets after fitting and anchoring
  • zoom: extra scale multiplier applied after fit mode

For keeping different models standing on the same ground line, a good default is:

<Live2D
  modelJsonPath="/models/Hiyori/Hiyori.model3.json"
  coreScriptSrc="/cubism/core/live2dcubismcore.min.js"
  renderOptions={{
    fitMode: 'height',
    anchorY: 'bottom'
  }}
/>

Important

This package does not include:

  • Live2D Cubism Core
  • model assets

You must obtain and serve those yourself.

Licensing

This repository contains:

  • original wrapper code for live2d-react
  • vendored files from Live2D Cubism Web Framework in src/cubism/framework
  • adapted runtime/sample-derived files in src/cubism/runtime

The framework subtree is vendored from the official Cubism SDK for Web Framework/dist output to keep local modifications to a minimum.

See LICENSE.md for distribution notes.

This package is not legal advice. If you plan to publish commercial software, verify your obligations under the relevant Live2D licenses.