Skip to Content
DocsAPIAPI Reference

API Reference

react-pxl exports a minimal API surface — just two functions and standard JSX elements.

Quick Reference

ExportDescription
render(element, canvas)Render a React element tree to a canvas
unmount(canvas)Unmount and clean up a canvas

Elements

react-pxl supports standard HTML elements as JSX — no special imports needed:

// Just use normal HTML elements <div> <h1>Title</h1> <p>Paragraph text</p> <img src="photo.jpg" /> <button onClick={handleClick}>Click</button> </div>

See the guides for details on each feature:

  • DOM Compatibility — supported elements and style merging
  • Styling — inline styles, Tailwind, and element defaults
  • Events — pointer, keyboard, focus, and scroll events
  • Images — async loading, object-fit, and border-radius
  • Scrolling — scroll containers and viewport culling
Last updated on