npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-quizifyy-component

v1.0.2

Published

A reusable Quiz component for React

Readme

🚀 React Quiz App

A dynamic and interactive quiz application built with React. Features real-time answer selection, smooth timer animation, result tracking, and a detailed summary page. Ideal for assessments, learning platforms, or trivia games.

screenshot


✨ Features

  • 📝 Interactive multiple-choice questions
  • ⏱️ Live countdown timer with smooth animation
  • ✅ Real-time answer tracking and validation
  • 📊 Detailed summary of correct and incorrect answers
  • ⚛️ Built using React functional components and hooks
  • 🔄 Clean codebase with reusable components

📦 Installation

Install via npm:

npm install react-quizify-component

⚙️ Basic Usage

import React from 'react';
import QuizApp from 'react-quiz-app';

function App() {
  return <Quiz />;
}

📂 Using Custom Questions

To add your own quiz content, create a questions.js file in your project and export an array of question objects like this:

// questions.js
export default [
  {
    id: 'q1',
    text: 'Which of the following definitions best describes React.js?',
    answers: [
      'A library to build user interfaces with help of declarative code.',
      'A library for managing state in web applications.',
      'A framework to build user interfaces with help of imperative code.',
      'A library used for building mobile applications only.',
    ],
  },
  {
    id: 'q2',
    text: 'What purpose do React hooks serve?',
    answers: [
      'Enabling the use of state and other React features in functional components.',
      'Creating responsive layouts in React applications.',
      'Handling errors within the application.',
      'Part of the Redux library for managing global state.',
    ],
  },
  {
    id: 'q3',
    text: 'Can you identify what JSX is?',
    answers: [
      'A JavaScript extension that adds HTML-like syntax to JavaScript.',
      'A JavaScript library for building dynamic user interfaces.',
      'A specific HTML version that was explicitly created for React.',
      'A tool for making HTTP requests in a React application.',
    ],
  },
];

📌 Note:

  • The first answer in the answers array is considered the correct answer.
  • Each question must have a unique id.

✅ Import and Use in App:

import questions from './questions';

function App() {
  return <Quiz questions={questions} />;
}

🎯 Component API

<Question />

Displays a single question with options.

Props:

| Prop | Type | Description | |-------------------|----------|------------------------------------------| | question | object | Question text and answer options | | index | number | Current question index | | onSelectAnswer | func | Callback when answer is selected |


📈 Summary Page

At the end of the quiz, the summary includes:

  • ✅ Number of correct answers
  • ❌ Number of wrong answers
  • ❌ Number of skipped answers
  • 🧾 List of all questions, selected answers, and correct answers

Useful for review and performance insight.


🛠 Development Log

  • ✅ Designed and implemented summary page with result breakdown
  • ✅ Displayed correct and incorrect answer counts
  • ✅ Returned a detailed list of user answers
  • ✅ Refactored props structure for cleaner component interface
  • ✅ Improved progress bar transition for smoother experience