CTRLLR

CTRLLR Documentation

Welcome to CTRLLR — a library for controlling your apps with your phone as a controller.

What is CTRLLR?

CTRLLR provides a simple, type-safe API for integrating gamepad controls into your web applications. Whether you're building games, creative tools, or accessibility features, CTRLLR makes input handling straightforward.

Features

  • Cross-platform support — Works on desktop and mobile browsers
  • TypeScript first — Fully typed API for better DX
  • Framework agnostic — Use with React, Vue, vanilla JS, or any framework
  • Customizable mappings — Remap buttons and axes to fit your needs

Quick Example

import { CtrllrManager } from '@ctrllr/core';

const ctrllr = new CtrllrManager({ signalingUrl: '...' });

ctrllr.on('controllerconnected', ({ controller }) => {
  console.log(`controller connected:`);
  console.log(
    `${controller.index}: ${controller.username} with ID ${controller.userId}`
  );
  controller.on('statechange', () => {...})
  controller.on('buttonpress', () => {...})
});

Ready to dive in? Head to the Getting Started guide.