# shower-gamepad

> 🔨 Support Gamepad API in shower.js (presentation architecture).

Latest version **2.0.0** (published 2026-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install shower-gamepad
pnpm add shower-gamepad
yarn add shower-gamepad
bun add shower-gamepad
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-12-01 |
| First published | 2016-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=12.20.0 |
| Dependencies | 0 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Piotr Kowalski |
| Maintainers | piecioshka |
| Keywords | gamepad, api, shower, presentation, slides, support |

## Links

- npm: https://www.npmjs.com/package/shower-gamepad
- Repository: https://github.com/piecioshka/shower-gamepad
- Homepage: https://github.com/piecioshka/shower-gamepad#readme
- Issues: https://github.com/piecioshka/shower-gamepad/issues
- npm.io page: https://npm.io/package/shower-gamepad

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-12-01
- 1.0.6 — 2025-01-20
- 1.0.5 — 2024-10-16
- 1.0.4 — 2024-10-16
- 1.0.3 — 2024-10-04
- 1.0.2 — 2016-08-04
- 1.0.1 — 2016-04-10
- 1.0.0 — 2016-04-10

## README

# shower-gamepad

[![node version](https://img.shields.io/node/v/shower-gamepad.svg)](https://www.npmjs.com/package/shower-gamepad)
[![npm version](https://badge.fury.io/js/shower-gamepad.svg)](https://badge.fury.io/js/shower-gamepad)
[![downloads count](https://img.shields.io/npm/dt/shower-gamepad.svg)](https://www.npmjs.com/package/shower-gamepad)
[![size](https://packagephobia.com/badge?p=shower-gamepad)](https://packagephobia.com/result?p=shower-gamepad)
[![license](https://img.shields.io/npm/l/shower-gamepad.svg)](https://piecioshka.mit-license.org)

🔨 Support `Gamepad API` in [shower.js](https://shwr.me/) (presentation architecture).

## Setup

Installation:

```bash
npm install shower-gamepad gamepad-api @shower/core
```

`gamepad-api` (2.x) and `@shower/core` (3.x) are peer dependencies, so install them next to the plugin.

### With `<script>` tags

Load the scripts in this order, all with `defer` (Shower 3 loads its core with `defer` too). The plugin connects `window.shower` with `window.GamepadAPI` by itself:

```html
<script src="node_modules/@shower/core/dist/index.js" defer></script>
<script src="node_modules/gamepad-api/dist/gamepad-api.js" defer></script>
<script src="node_modules/shower-gamepad/dist/shower.gamepad.js" defer></script>
```

The paths are relative to your presentation's `index.html`. A missing library ends with a readable error in the console.

### With a bundler

```javascript
import GamepadAPI from 'gamepad-api';
import { attachGamepad } from 'shower-gamepad'; // or: require('shower-gamepad')

const plugin = attachGamepad(window.shower, GamepadAPI);

// later, to stop listening to the pad:
plugin.detach();
```

The optional third argument changes the buttons, e.g. `attachGamepad(window.shower, GamepadAPI, { bindings: { next: ['shape:cross'] } })`. Actions: `next`, `prev`, `toggleFullMode`; event names come from [`gamepad-api`](https://www.npmjs.com/package/gamepad-api).

## Controls

Buttons follow the [W3C standard mapping](https://www.w3.org/TR/gamepad/#remapping) (Xbox, PlayStation and most other pads).

| Action                      | Buttons                                                 |
| --------------------------- | ------------------------------------------------------- |
| Next slide                  | D-pad right or down, circle (B), R1, stick to the right |
| Previous slide              | D-pad left or up, square (X), L1, stick to the left     |
| Toggle the full mode        | Start                                                   |

One press moves one slide, a held button does not repeat.

The legacy `shower-core` 2.x still works (`window.shower` from `shower-core/shower.min.js`), there Start toggles the slide mode.

## Demo

`demo/index.html` uses the packages from `node_modules`: run `npm install`, `npm run build` and open the file in a browser with a pad connected.

### License

[The MIT License](https://piecioshka.mit-license.org) @ 2026

---
_Source: https://npm.io/package/shower-gamepad · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
