Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pocket-stack/pocketjs/llms.txt

Use this file to discover all available pages before exploring further.

PocketJS is a high-performance JSX UI framework that takes your Solid or Vue Vapor components and runs them on real Sony PSP hardware, the PPSSPP emulator, the browser via WebAssembly, and headless Bun — all from one build. Layout, animation, and text rendering happen inside a compact no_std Rust core; your components stay ordinary framework JSX.

Introduction

What PocketJS is, how it works, and when to use it.

Quickstart

Write a component, build it, and see it run in minutes.

Architecture

One Rust core, four hosts, one layout engine everywhere.

API Reference

Every export from @pocketjs/framework, fully documented.

What makes PocketJS different

PocketJS is not a browser-first framework ported to embedded hardware. It was designed from the start to run on a 333 MHz MIPS CPU with 8 MB of RAM — and the constraints that required shape every API decision.

Zero Runtime CSS

Class strings are compiled to a binary style table at build time. A class is just an integer on the device — no parser, no cascade, no string matching.

Native Animation

Tweens and springs tick in Rust at a fixed dt = 1/60 s. After you call animate(), JavaScript is not involved again until the tween ends.

Baked Font Atlases

The build scans your source for the exact characters you use and rasterizes only those Inter glyph slots. No font engine runs on the device.

Solid + Vue Vapor

Both frameworks target the same retained native tree. Switch adapters without changing your Rust core, styling pipeline, or asset pack.

Byte-Exact Goldens

Animation uses a fixed timestep — frame content is a pure function of the frame index. Tests produce byte-exact PNG goldens on every run.

One Build, Four Hosts

PSP hardware, PPSSPP emulator, browser canvas, and headless Bun all run the same .pak artifact from the same two-pass build.

Get started fast

1

Clone and install

git clone https://github.com/pocket-stack/pocketjs
cd pocketjs
bun install
2

Write a component

Create demos/hero/app.tsx using View, Text, and Tailwind-subset class strings. State comes from solid-js or vue — whichever framework you prefer.
3

Build and run

bun scripts/build.ts hero   # produces dist/hero.js + dist/hero.pak
bun scripts/dev.ts          # builds the wasm core and serves at localhost:8130
4

Ship to PSP

bun scripts/psp.ts hero     # cross-compiles an EBOOT.PBP for real hardware

Explore the docs

Building UIs

View, Text, Image, control flow, and all the app-shell primitives.

Styling

How build-time Tailwind classes compile to a binary style table.

Animation

Declarative transitions and the imperative animate() / spring() API.

Input & Focus

D-pad traversal, focus scopes, button handlers, and the PSP button map.

Frameworks

Switch between Solid and Vue Vapor without changing the native layer.

PocketJS AOT

A separate GBA-class cartridge runtime using TypeScript and JSX as a DSL.

Build docs developers (and LLMs) love