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

wp-chessboard-solid

v0.1.0

Published

Web-native SolidJS chessboard — DOM/SVG port of the wp_chessboard Flutter widget. No wasm, no runtime dependencies.

Readme

wp-chessboard-solid

Web-native SolidJS chessboard — a DOM/SVG port of the wp_chessboard Flutter widget. No wasm, no canvas, no runtime dependencies. ~7.4 KB gzipped including the bundled piece set (the Flutter web embedding it replaces ships ~1.6 MB of app JS plus a multi-megabyte CanvasKit wasm).

Install

npm install wp-chessboard-solid solid-js

Usage

import { WPChessboard } from "wp-chessboard-solid";

function App() {
  const [fen, setFen] = createSignal(
    "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
  );

  return (
    <WPChessboard
      fen={fen()}
      size={600}
      lightColor="#f0d9b5"
      darkColor="#b58863"
      interactive
      onMove={({ from, to }) => {
        // validate with your chess engine of choice, then:
        setFen(nextFen);
      }}
    />
  );
}

The component is fully controlled: it never mutates the position itself. Handle onMove/onTap, validate the move (e.g. with chess.js), and set the new fen — pieces slide to their new squares with a 200 ms animation derived from the FEN diff, exactly like the Flutter widget.

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | fen | string | — | Position (placement field is enough) | | size | number | 400 | Board edge length in px | | orientation | "white" \| "black" \| boolean | "white" | true = black at bottom (legacy compat) | | lightColor / darkColor | string | #EEEEEE / #757575 | Square colors | | interactive | boolean | false | Enable tap + drag input | | animated | boolean | true | Animate piece slides on fen change | | animationDurationMs | number | 200 | Slide duration | | moveHints | { selected?, targets? } | — | Selected-square fill + move-target dots | | arrows | { from, to, color? }[] | — | Arrows drawn over the board | | ghostOnDrag | boolean | false | Show origin piece at 20% opacity while dragging | | dropIndicator | boolean \| { color? } | off | Highlight hovered square while dragging | | shortcuts | boolean \| { commitMode?, highlightColor? } | off | Keyboard square selection: ah, 18, space commits (commitMode: "auto" commits on the digit) | | turnTopPlayerPieces | boolean | false | Rotate the top player's pieces 180° | | pieces | Partial<Record<PieceChar, (size) => JSX.Element>> | cburnett | Per-piece renderer overrides | | renderSquare | (info: SquareInfo) => JSX.Element | — | Custom square renderer |

Events: onMove({from, to, piece}), onTap({square, piece}), onPieceTap, onEmptyFieldTap, onPieceStartDrag, onFenChanged(fen).

Piece components (WhiteKingBlackPawn) and defaultPieceMap are exported for reuse; FEN helpers parseBoard, squareToIndex, indexToSquare too.

Development

npm install
npm test        # vitest unit tests (fen diff, coords)
npm run build   # dist/index.js (ESM) + .d.ts

The package ships raw .tsx source under the "solid" export condition, so Solid-aware bundlers (vite-plugin-solid) compile it with your app for full reactivity; other tools use the compiled ESM in dist/.

License

Code: MIT (same as the parent repo).

Piece graphics: the cburnett chess set by Colin M.L. Burnett, licensed CC-BY-SA 3.0 (via lichess-org/lila).