Back to components
ComponentWidgetFree

Pong Game React component

A canvas Pong against a bot opponent, four glass themes, three difficulty levels, multi-round progression with a speed increase each round, keyboard and pointer paddle control, and an optional popup/widget mode.

About the Pong Game component

Pong Game is a one-player table tennis match against the computer, drawn on a canvas. You control the left paddle and the computer the right one. A match runs over ten rounds, each won by reaching a target score (5 points in the first rounds, down to a single point in the last), and each new round makes the ball and both paddles faster.

You move the paddle with W and S or the arrow keys, or by dragging on the court with a mouse or a finger. Clicking or tapping the court starts the game. Players pick Easy, Medium or Hard, which change the ball speed and how quickly the computer follows it. theme picks arcade, neon, tournament or classic, and lightMode switches to a light court. The game pauses its loop while it is scrolled out of view.

When to use it

Use it on an agency or developer portfolio, a sports or gaming site, a 404 page or as a popup game a visitor can open from a button.

For a game that can be played with one finger and no timing, use Memory Match Game or 2048 Game.

Installation

Add the Pong Game component to your project with the shadcn CLI. It lands in components/pong-game.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/pong-game

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

More Widget components

Dino Runner Game
Free
Memory Match Game
Free
Space Invaders Game
Free
Minesweeper Game
Free
Glow Jump Widget
Free
Snake Game
Free