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

vue3-pixi-components

v1.0.5

Published

> Use Vue 3 to create PixiJS applications

Readme

vue3-pixi-components

Use Vue 3 to create PixiJS applications

This library provides it's own vue renderer that will create PixiJS objects instead of html elments. It's still pretty early in development, but should already support a great amount of features from PixiJS.

<script setup lang="ts">
import textureUrl from "@/assets/myTexture.png";
import { Reactangle } from "pixi.js";

const texture = Texture.from(textureUrl);
const hitArea = new Rectangle(0, 0, 64, 64);

function onClick() {
  console.log('sprite was clicked!');
}
</script>

<template>
  <container>
    <sprite :texture="texture" :hit-area="hitArea" @click="onClick" />
  </container>
</template>

Install

# install with npm
npm install vue3-pixi-components

# install with yarn
yarn add vue3-pixi-components

Creating an application manually

import { createPixiApp } from "vue3-pixi-components";
import App from "./App.vue";

const pixiApp = new PIXI.Application();

document.body.appendChild(pixiApp.view);

const app = createPixiApp(App);

app.mount(pixiApp.stage);

Using the PixiViewport component

The PixiViewport component can be used to embed a pixi app into an existing vue app.

<script setup lang="ts">
import { PixiViewport } from "vue-3-pixi-components";
</script>

<template>
  <div>
    <PixiViewport :width="640" :height="480">
      <!-- Everything in here is going to be PixiJS objects -->
    </PixiViewport>
  </div>
</template>

Install the vite plugin

The vite plugin adds the ability to specify texture paths on sprites & other components that use textures, the same way as the src attribute on an image.

// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { vuePixi, isCustomElement } from "vue3-pixi-components/vite";

export default defineConfig({
  plugins: [
    vue({
      template: {
        // remove the unknown element warnings
        compilerOptions: { isCustomElement },
      },
    }),
    vuePixi(),
  ],
});

Usage in template

The vite plugin will detect any texture props containing the path to an image, and will replace it with a reference to a texture object.

<sprite texture="@/assets/myTexture.png" />

Components

The following PixiJS objects are supported out of the box:

  • Container
  • Sprite
  • Graphics
  • Text
  • BitmapText
  • TilingSprite
  • AnimatedSprite
  • Mesh
  • NineSlicePlane
  • SimpleMesh
  • SimplePlane
  • SimpleRope

Props

Most props will work just as the properties on the corresponding PixiJS objects. However, props that accept a Point are handeled a bit different. They can also be used with X/Y suffix (except for the position prop, which just uses the x/y props instead).

<container :scale-x="10" :skew-y="0.5" />

Events

All events emitted by pixi objects are supported. Some of vue's event modifiers will work, like @click.left, however more often than not using them will cause an error. Adding an event listener to an element will currently automatically set the element's eventMode to static.

Graphics @draw event

When using <grahpics /> there is a special @draw event. This will set up a watchEffect internally that will automatically call the event handler again if any dependencies on the draw method have changed.

<script setup lang="ts">
import { Graphics } from "pixi.js";

const props = defineProps<{
  x: number
  y: number
  width: number
  height: number
}>()

function draw(g: Graphics) {
  g.clear()
  g.lineStyle(3, 0xffffff)

  const { x, y, width, height } = props
  g.drawRoundedRect(x, y, width, height, 5)
}
</script>

<template>
  <graphics @draw="draw" />
</template>