Skip to content

🎲 A React implementation of the dice game Tenzies, built with hooks, reusable components, and accessible design.

Notifications You must be signed in to change notification settings

candytale55/react-tenzies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎲 React Tenzies β€” A Mini Game for Practicing React State and Accessibility

Description

A fast, responsive mini-game built with React to explore component state, interactivity, and accessibility best practices. Roll until all dice match β€” click dice to hold their value between rolls and keep going until every die shows the same number.


Tech Stack

Core

  • React (Vite)
  • JavaScript (ES6+)
  • CSS3 (Grid & Flexbox)

Tooling & Libraries

  • ESLint
  • nanoid
  • react-confetti
  • react-use

Live Demo

Play React Tenzies on Netlify


Project Structure

src/
β”œβ”€β”€ components/
β”‚   └── Die.jsx
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ docs/
β”‚   β”‚   β”œβ”€β”€ future-todos.md
β”‚   β”‚   └── pseudocode.md
β”‚   └── shots/
β”‚       β”œβ”€β”€ scsh-01.png
β”‚       β”œβ”€β”€ scsh-02.png
β”‚       └── scsh-03.png
β”œβ”€β”€ App.jsx
β”œβ”€β”€ main.jsx
└── index.css

Screenshots

Game Start Selected Dice Game Won
Game Start Selected Dice Game Won

Learning Outcomes

Through this project I practiced:

  • Managing component state and derived logic in React
  • Handling accessibility with aria-pressed, aria-live, and keyboard focus
  • Lazy state initialization and conditional rendering
  • Responsive layouts with CSS Grid and Flexbox
  • Integrating third-party React libraries for UX polish

Future Improvements

Detailed refactor ideas, accessibility updates, and planned features are documented here: ➑️ future-todos.md

These include:

  • Extracting game logic into a custom hook
  • Adding roll animations and dark mode
  • Persisting scores and game state

βš™οΈ Getting Started

  1. Clone the repository

    git clone https://github.com/yourusername/react-tenzies.git
    cd react-tenzies
  2. Install dependencies

    npm install
  3. Run the app locally

    npm run dev

Notes for Future Development

Note: Keep all dice state in the parent (App) to maintain a single source of truth. Avoid derived or duplicated state in child components. Use refs for DOM focus management without triggering re-renders. See future-todos.md for more technical notes.


References


πŸ“… Project Status

Completed: October 2025

Status: Functional and stable β€” future improvements planned


Summary

This project demonstrates React fundamentals, accessibility awareness, and thoughtful UI design β€” packaged into a clean, self-contained mini-game. It’s designed as both a learning project and a showcase of professional development practices.


About

🎲 A React implementation of the dice game Tenzies, built with hooks, reusable components, and accessible design.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published