Quiz Framework — A Lightweight Quiz Engine for React

quiz-ui's core is a lightweight quiz framework: a single useReducer-based state machine that handles step transitions, branching resolution, answer collection, and progress calculation. The entire engine is under 200 lines of TypeScript — read it, understand it, extend it.

Last updated: 2026-09-25

Frequently asked questions

  • How does the quiz engine work?

    The engine is a reducer that responds to ANSWER, ADVANCE, BACK, GO_TO, and RESET actions. Branching is done by evaluating branch rules (equals/includes) against collected answers.

  • Can I extend the engine?

    Yes — the source lands in your project. Add new action types, modify the branching logic, or integrate external state.

  • What's the bundle size impact?

    Minimal. The engine has zero external dependencies beyond React itself. Most components are under 100 lines.