• Stars
    star
    2,167
  • Rank 20,519 (Top 0.5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated 5 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Write PIXI apps using React declarative style

pixi-react

Pixi React

Simply the best way to write PIXI applications in React
Write PIXI applications using React declarative style πŸ‘Œ


release downloads ci tests license react version pixi version


Pixi React is an open-source, production-ready library to render high performant PIXI applications in React.

News!

We're delighted to announce Pixi React v7.0.0, the first major release since making it an official Pixi package!

While all the core components remain the same, there have been some significant changes under the hood:

  • Full React 18 support including a new createRoot API, matching the signature of React 18's ReactDOM/client
  • Full Pixi V7 support
  • New up-to-date docs site
  • Repository converted to a monorepo with separate @pixi/react and @pixi/animated packages
  • Internally all pixi.js library imports were replaced with @pixi/ scoped package versions, providing bundlesize improvements for users who use modular builds
  • Scoped imports allowed us to remove @pixi/react-legacy and @pixi/react-animated-legacy packages, with rendering deferred to a user's installed pixi.js package
  • sideEffects: false added to package.json to support tree-shaking

We're excited to see what the community builds with the library and as ever please let us know on GitHub if you run into any issues, or reach out to us on the Discord to chat.

Thanks! PixiJS Team

Get started

Quick start

If you want to start a new React project from scratch, we recommend Create React App. To add to an existing React application, just install the dependencies:

Start New React Project "my-app" with Create React App:

# for typescript add "--template typescript"
npx create-react-app my-app
cd my-app

Install Pixi React Dependencies:

npm install pixi.js @pixi/react

Usage:

import { BlurFilter } from 'pixi.js';
import { Stage, Container, Sprite, Text } from '@pixi/react';
import { useMemo } from 'react';

export const MyComponent = () =>
{
  const blurFilter = useMemo(() => new BlurFilter(4), []);

  return (
    <Stage>
      <Sprite
        image="https://pixijs.io/pixi-react/img/bunny.png"
        x={400}
        y={270}
        anchor={{ x: 0.5, y: 0.5 }}
      />

      <Container x={400} y={330}>
        <Text text="Hello World" anchor={{ x: 0.5, y: 0.5 }} filters={[blurFilter]} />
      </Container>
    </Stage>
  );
};

Docs

Check out our documentation for guides and a full API reference.

Or checkout our examples on codepen for inspiration.

Contribute

Want to contribute to Pixi React? Our contributing guide has you covered.

License

Pixi React is MIT licensed.

This project was originally created and maintained by @inlet. He graciously gave the Pixi team the keys to maintain and push the project forward. Big thanks for all the hard work on making this project so awesome.

This projects codebase was originally forked from @michalochman 's react-pixi-fiber.

Meet fellow developers

You have an amazing feature in mind or just want to get in touch with other developers? Feel free to join our Discord channel.

Join us on Discord

More Repositories

1

pixijs

The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
TypeScript
42,668
star
2

filters

Collection of community-authored custom display filters for PixiJS
TypeScript
886
star
3

particle-emitter

A particle system for PixiJS
TypeScript
777
star
4

spine

Pixi.js plugin that enables Spine support.
TypeScript
538
star
5

examples

Rendering examples using PixiJS and related plugins
JavaScript
469
star
6

sound

WebAudio API playback library, with filters. Modern audio playback for modern browsers.
TypeScript
376
star
7

pixi-ui

Provide a definitive user experience in your PixiJS application without any frontend library!
JavaScript
299
star
8

tilemap

Rectangular tilemap implementation for PixiJS
TypeScript
275
star
9

pixi-typescript

Typescript definitions for Pixi.js
TypeScript
238
star
10

layers

Separate the z-hierarchy of your scene tree from its canonical structure.
TypeScript
220
star
11

animate

PixiJS runtime library for content from Adobe Animate CC
JavaScript
198
star
12

lights

Adds dynamic lighting via deferred shading to PixiJS
TypeScript
191
star
13

open-games

TypeScript
190
star
14

pixi-projection

TypeScript
186
star
15

pixi-haxe

Externs of Pixi.js for Haxe
Haxe
179
star
16

graphics-smooth

Drop-in replacement for Graphics but with anti-aliasing
TypeScript
151
star
17

ui

Commonly used UI components for PixiJS
TypeScript
149
star
18

animate-extension

Custom Platform Plugin for Adobe Animate CC (Formerly Adobe Flash CC) - to export animation for the PixiJS renderer
C++
124
star
19

pixi-heaven

PIXI.js advanced color modes, sprites, meshes
TypeScript
115
star
20

pixi-compressed-textures

Compressed textures and retina support for pixijs. Loader can choose textures depends on platform and rendering mode.
TypeScript
92
star
21

pixi-native

A native version of pixi
Kotlin
85
star
22

pixi-gl-core

A set of tidy little pixi objects that make working with WebGL simpler
JavaScript
83
star
23

assetpack

TypeScript
77
star
24

pixi-extra-filters

[deprecated] Please see https://github.com/pixijs/pixi-filters
JavaScript
66
star
25

pixi-particles-editor

PIXI-based particle editor
JavaScript
65
star
26

picture

A plugin that includes a sprite renderer that reduces border artifacts and 3 blend mode implementations for WebGL
TypeScript
61
star
27

layout

Library for arranging/resizing pixiJS rendered elements basing on css like configs
TypeScript
53
star
28

html-text

Multi-Style Text Rendering Plugin for PixiJS
TypeScript
38
star
29

gif

Plugin to support playback of animated GIF images in PixiJS.
TypeScript
35
star
30

pixi-jsdoc-template

PixiJS Flavored JSDoc Template
JavaScript
30
star
31

extension-boilerplate

Pixi.js example renderer plugin. Clamps textures to reduce border artifacts.
TypeScript
30
star
32

pixijs.com

JavaScript
30
star
33

pixi-text-style

PIXI.TextStyle Generator
JavaScript
30
star
34

floss

Unit-testing for those hard to reach places
TypeScript
28
star
35

storybook

TypeScript
27
star
36

node

Run PixiJS but in Node.js environments, no browser required!
TypeScript
25
star
37

bunny-mark

Simulation for performance testing PIXI releases
JavaScript
20
star
38

devtools

TypeScript
18
star
39

batch

PixiJS batch rendering plugin library
TypeScript
17
star
40

pixify

Browserify bundle process for PIXI libraries
JavaScript
16
star
41

guides

PixiJS User Guides
SCSS
12
star
42

customize

Customize the list of packages to use for PixiJS v5
TypeScript
11
star
43

animate-examples

Document Examples for testing PixiAnimate publishing
10
star
44

docs

API Documentation container
HTML
9
star
45

examples-v4

Rendering examples using PixiJS v4 and related plugins
JavaScript
9
star
46

spine-v8

TypeScript
9
star
47

extension-scripts

Build-time scripts for setting up extensions
JavaScript
6
star
48

pixi-closure-compiler

closure compiler externs for pixijs
JavaScript
6
star
49

eslint-config

ESLint config for pixi.js plugin/integration libraries
JavaScript
5
star
50

webdoc-template

PixiJS template ported to webdoc
TypeScript
4
star
51

generator-pixi-plugin

A Yeoman generator for creating pixi.js plugins.
JavaScript
4
star
52

bundler

Bundle all release into a single package
JavaScript
3
star
53

pixi-animate-tests-tool

Used to generate unit tests solutions for PixiAnimate
JavaScript
3
star
54

legacy.pixijs.com

SCSS
3
star
55

examples-v5

Rendering examples using PixiJS and related plugins
JavaScript
2
star
56

webworker-plugins

TypeScript
1
star
57

examples-v7

JavaScript
1
star