Back to components
ComponentWidgetFree

Tic Tac Toe Game React component

A playable Tic Tac Toe board with a built-in AI opponent, animated piece placement, a drawn winning-line reveal, score tracking, and a confetti burst on a win.

About the Tic Tac Toe Game component

Tic Tac Toe Game is a playable noughts and crosses board. You play Circle and move first, and a computer opponent answers as Cross after a short pause. The marks spring in, a line is drawn through the winning row, confetti falls at the end of each game, and a scoreboard keeps count of wins for each side and ties until the page is reloaded.

Set enableAI={false} to make it a two-player game on one screen, taking turns. circleColor and crossColor set the two marks, and boardColor and squareColor the grid. It can sit inline on the page, or as a "Mini Game" pill button that opens the board in a popup, either on click or automatically after a delay or on scroll.

When to use it

Use it as a small playful extra on a portfolio, an agency site, a 404 page or a waiting screen, or as an engagement widget that visitors can open from a button.

For a game that rewards the visitor with a discount code, use Spin to Win Wheel or Dice Roll Discount Popup.

Installation

Add the Tic Tac Toe Game component to your project with the shadcn CLI. It lands in components/tic-tac-toe-game.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/tic-tac-toe-game

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

More Widget components

2048 Game
Free
Coin Flip Game
Free
Snake Game
Free
QR Code Widget
Free
Minesweeper Game
Free
Google Maps Embed
Free