Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add optional click tracking to clickable components

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
react, typescript

Research direction

Start by reviewing the listed interactive components—BBButton, BBBCheckbox, BBBToggle, BBBAccordion, BBBNavigation, BBBSelect, BBBSearch, and BBBModal—and how their interaction callbacks are implemented. Use the proposed src/clickTracker.ts module and inspect the library's export path. Done means id-bearing interactions produce the requested report, resetClickReport clears it, and components without ids retain existing behavior.

Written by the indexing model from the issue text.

Description

enhancement

Is your feature request related to a problem? Please describe.
Consumers of this library often need to track which components are being interacted with for analytics or usage telemetry purposes. Currently, they must manually wrap every component's onClick to collect this data, which is repetitive boilerplate that has to be maintained outside the library.

Describe the solution you'd like
An opt-in, zero-configuration click tracking system built into the library. When a consumer passes an id prop to any clickable component, clicks are automatically counted in an internal store. The consumer retrieves the report by calling a single exported function whenever needed.

// src/clickTracker.ts (new module)
export function getClickReport(): Record<string, number>
export function resetClickReport(): void

// internal — called by components
function trackClick(id: string): void

Describe alternatives you've considered

  • Base class / class inheritance: Discarded — this library uses functional components with hooks throughout. A class hierarchy would require rewriting all components and goes against React's compositional model.
  • Higher-Order Component (HOC): Would work but adds unnecessary wrapping complexity for a use case that doesn't require it.
  • Context + Provider: Makes the system reactive (triggers re-renders), but requires consumers to wrap their app with a <ClickTrackerProvider>, which is unnecessary overhead for a simple analytics report.

Affected component(s)
All components that have meaningful user interaction:

  • BBButton
  • BBBCheckbox
  • BBBToggle
  • BBBAccordion (expand/collapse)
  • BBBNavigation (item clicks)
  • BBBSelect (option selection)
  • BBBSearch (search action)
  • BBBModal (action buttons)

Proposed API / Usage Example

import { BBButton, BBBToggle, getClickReport, resetClickReport } from '@mconf/bbb-ui-components-react';

// No setup required — tracking activates automatically when id is passed
function App() {
  return (
    <>
      <BBButton id="confirm-btn" onClick={handleConfirm} label="Confirm" />
      <BBBToggle id="notifications-toggle" onChange={handleToggle} />
    </>
  );
}

// Retrieve the report whenever needed (e.g. on page unload, on user logout)
const report = getClickReport();
// → { "confirm-btn": 14, "notifications-toggle": 3 }

sendToAnalytics(report);
resetClickReport(); // optional: reset counters

Components without an id prop are silently ignored — zero behavior change for existing consumers.

Screenshots or mockups
N/A

Additional context

  • TypeScript type ClickReport = Record<string, number> should be exported alongside the functions.
  • resetClickReport() enables consumers to segment data by session or time window.
  • The module is a singleton (module-level Map<string, number>), so it works across the entire component tree without any provider or context setup.
  • Easily testable: call resetClickReport() between tests to isolate state.
Dominant language
TypeScript
Stars
2
Forks
5
Avg merge
2d 5h
Merged PRs (30d)
9

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigbluebutton/bbb-ui-components-react

All issues in bigbluebutton/bbb-ui-components-react

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.