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

pixi-silk

v1.5.2

Published

Smooth vector graphics for PixiJS v8: analytic anti-aliased SDF primitives, squircles, arcs, polylines, dashes, OKLab gradients, glows and DPR-exact canvases, one draw call per object.

Readme

pixi-silk

Smooth vector graphics for PixiJS v8. Every shape is an exact signed distance field that the shader anti-aliases per pixel, so edges stay clean at any zoom, rotation and device pixel ratio, without MSAA.

npm CI pixi.js license

Docs | Getting started | API reference | Studio | Showcase | FAQ

Contents

Why pixi-silk

Pixi Graphics turns a shape into triangles once. The edge is only as smooth as the triangles and the canvas antialiasing allow, and a hairline or a slow drift shows it. SilkGraphics sends each shape to the shader as a few numbers and evaluates its exact distance field for every pixel.

  • Edges stay smooth under zoom, rotation, sub-pixel motion and any device pixel ratio. MSAA stays off.
  • An API close to Graphics. rect, roundRect, circle, moveTo, lineTo, fill, stroke and the transform stack work as you expect, so moving code over is mostly a rename.
  • More than Graphics draws. Squircle corners, tapered and dashed strokes, round joins on any path, shape unions and cut-outs, gradients along a stroke, blur, inner and outer shadows, glow and glass.
  • Few draw calls. A SilkGraphics packs its shapes into instances. After enableSilkBatching(), consecutive SilkGraphics with the same blend mode render in one draw call.
  • Bundles only what you import. One entry point per area, sideEffects: false, and the WebGPU shader loads only when WebGPU runs.
  • Text, layout and widgets on the same rendering. Distance field text in any script, a flex layout engine, buttons, radial menus, counters and an editor kit.

Install

npm install pixi-silk pixi.js

pixi.js 8.6 or newer is a peer dependency. pnpm and yarn work the same.

AI agent skills

pixi-silk ships ten agent skills. A router skill picks the right one for the task. The others cover drawing, paint, text, localized text, layout, widgets, the editor kit, app setup and moving code from Graphics. They follow the open Agent Skills format, so Claude Code, Codex, Cursor, Gemini CLI, Copilot and any agent that reads SKILL.md files can use them. Every code block in them type-checks against the library in CI.

Install them with the skills CLI, which finds your agents and puts the skills where each one looks:

npx skills add schmooky/pixi-silk --list             # see what is in the repo
npx skills add schmooky/pixi-silk                    # this project, pick agents and skills
npx skills add schmooky/pixi-silk -g                 # every project on this machine
npx skills add schmooky/pixi-silk -a claude-code -y  # one agent, no prompts

The skills also ship inside the npm package. After npm install pixi-silk they are in node_modules/pixi-silk/skills/, the same version as the code you installed: copy that folder to .claude/skills/, .agents/skills/ or .cursor/skills/.

Agents without skill support can read llms.txt, which indexes the docs as plain text. Contributors working on this repo should read AGENTS.md.

Quick start

import { conic, createSilkApp, SilkGraphics, vertical } from 'pixi-silk';

const { app } = await createSilkApp({ parent: document.getElementById('stage')!, background: 0x000000 });
const g = new SilkGraphics();

g.roundRect(10, 10, 340, 140, 22, 0.6).fill(0x1c1c1e); // radius 22, squircle smoothing 0.6
g.arcSweep(80, 80, 44, -Math.PI / 2, Math.PI * 1.5)
    .stroke({ width: 12, cap: 'round', gradient: conic([0x30d158, 0xffd60a, 0xff453a]) });
g.area([120, 100, 170, 80, 220, 92, 270, 60, 320, 70], 130, { smooth: 'monotone' })
    .fill(vertical([[0, 0xff9f0a, 0.8], [1, 0xff9f0a, 0]]))
    .stroke({ width: 2, color: 0xff9f0a, cap: 'round' });

app.stage.addChild(g);

That draws a squircle card, a gauge with a conic gradient and a smoothed area chart:

createSilkApp turns MSAA off and maps one canvas pixel to one device pixel. In your own Pixi Application, new SilkGraphics() works as it is. Getting started walks through both.

Gallery

Every clip is a live demo on the docs site, recorded in Chrome. Open a page to change its controls and read the code that draws it.

Coming from Graphics

Most Graphics code runs after a rename:

import { SilkGraphics } from 'pixi-silk';

const g = new SilkGraphics(); // was: new Graphics()

g.roundRect(0, 0, 200, 80, 16).fill(0x1c1c1e).stroke({ width: 2, color: 0x0a84ff });
g.moveTo(20, 60).lineTo(100, 20).lineTo(180, 60).stroke({ width: 3, color: 0xffffff, cap: 'round' });

Texture and pattern fills, svg() import and a shared GraphicsContext stay with Graphics, and the two can sit side by side in one scene. Migrating from Graphics lists every difference.

What is in the package

The root import holds SilkGraphics, gradients, createSilkApp, motion helpers and enableSilkBatching(). Everything else is its own entry point, so an app bundles only what it imports.

| Import | What it holds | |---|---| | pixi-silk | Shapes, lines, free paths, shape operations, gradients, blur and shadows | | pixi-silk/text | SilkText, distance field text | | pixi-silk/i18n, pixi-silk/i18n/pixi | Localized rich text, shaped at build time, in any script | | pixi-silk/i18n/canvas, pixi-silk/i18n/shaper | Player names inside localized messages | | pixi-silk/text/bidi | The Unicode Bidirectional Algorithm on its own | | pixi-silk/layout, pixi-silk/ui/layout | A flex layout engine and the Pixi containers built on it | | pixi-silk/glass, pixi-silk/glow | Glass and glow filters | | pixi-silk/webgpu | The WGSL shader, for WebGPU in your own Pixi app | | pixi-silk/webgl1 | Opt-in shaders for Pixi's WebGL1 fallback | | pixi-silk/ui/* | Buttons, radial menus, counters and the editor kit |

Choose an entry point lists every subpath. The editor kit (camera, rulers, gizmos, pickers, panels) is experimental in 1.x: its API may change in a minor release.

Localized text

Translated messages in any script, Arabic and Hebrew included, are compiled ahead of time. The silk command of @pixi-silk/compiler reads a strings spreadsheet, your fonts and a theme. It shapes every message with HarfBuzz and writes .silk bundles and lossless WebP atlas pages. The game then downloads no font and no shaper.

npm install -D @pixi-silk/compiler
npx silk compile --config silk.config.json --strings strings.xlsx --theme theme.json --out public/i18n
import { Assets, extensions } from 'pixi.js';
import { Silk, SilkMessage, silkBundleLoader } from 'pixi-silk/i18n/pixi';

extensions.add(silkBundleLoader);
const silk = await Silk.create();

await silk.addBundle(await Assets.load('/i18n/ar.silk'));
const theme = silk.createTheme(await (await fetch('/i18n/theme.json')).json());
const set = await silk.prepare({
    locale: 'ar',
    theme,
    messages: { coins: { key: 'shop.coins', values: { count: 0 } } },
});
const coins = new SilkMessage(set.get('coins'));

app.stage.addChild(coins);
coins.set({ count: 1250 }); // rewrites only the digits

Localized text has the guide.

Requirements

  • pixi.js 8.6 or newer, as a peer dependency
  • WebGL2 or WebGPU. WebGL2 is the default. For WebGPU, pass preference: 'webgpu' to createSilkApp, or call enableWebGPU() from pixi-silk/webgpu before the first SilkGraphics in your own Pixi app
  • WebGL1 is opt-in: pass webgl1: enableWebGL1 from pixi-silk/webgl1 to createSilkApp

What pixi-silk does not do

| Not here | Use instead | |---|---| | Texture and pattern fills, svg() import, a shared GraphicsContext | Pixi Graphics or a Sprite next to SilkGraphics | | Blur and shadows on other display objects | Pixi filters. Silk effects act on silk shapes, from their distance field | | Routing, app state or DOM UI | Your app, or a DOM layer over the canvas | | A document model for editors | Your app's own model. Selection and History store references and commands | | Canvas 2D | A GPU renderer: WebGL2, WebGPU, or WebGL1 through pixi-silk/webgl1 |

The FAQ lists the other limits.

Contributing

A pnpm workspace. packages/pixi-silk is the library, packages/compiler is @pixi-silk/compiler and apps/site is the docs site.

pnpm install
pnpm site:dev                   # docs at http://localhost:5178
pnpm --filter pixi-silk test    # unit tests
pnpm build                      # library build

CONTRIBUTING.md covers checks, changesets and releases. The clips in this README are recorded from the docs demos by tools/readme-media.

Contributors

Thanks to everyone who has written code, docs and fixes for pixi-silk.

License

MIT