react-cookie-consent
by
Mastermindzh

Description: A small, simple and customizable cookie consent bar for use in React applications.

View on GitHub ↗

Summary Information

Updated 17 minutes ago
Added to GitGenius on February 18th, 2025
Created on February 1st, 2018
Open Issues & Pull Requests: 2 (+0)
Number of forks: 79
Total Stargazers: 638 (+0)
Total Subscribers: 3 (+0)

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (4)
  • Can't reproduce (2)
  • Solved - user code (2)
  • wontfix (2)
  • Lawful? (1)
  • No priority (1)
  • PossibleEnhancement (1)
  • enhancement (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 0.4 hours
Mean response time: 267.4 days
90th percentile: 1604.3 days
Tracked items: 6

Most active contributors

Detailed Description

The react-cookie-consent repository is a React library that provides a customizable cookie consent banner component for web applications. Written in TypeScript, it addresses the need for GDPR and EU cookie law compliance by offering developers a straightforward way to implement cookie consent functionality without extensive custom development.

The library serves as a banner component that displays a consent bar to users, typically positioned at the top or bottom of the browser window. The core functionality allows users to accept or decline cookies, with the component managing the storage and retrieval of consent preferences through browser cookies. The repository includes a live demonstration accessible through its Storybook interface at the project homepage, showing the default appearance and various customization options available to developers.

Key features of the library include flexible positioning of the consent bar, customizable button text and styling, support for both accept and decline actions, and the ability to trigger acceptance through user scrolling behavior. Developers can retrieve stored consent values using the exported getCookieConsentValue function or reset consent using resetCookieConsentValue. The component supports extensive customization through props, including options for custom CSS classes, inline styles, custom HTML attributes, and even custom React components for buttons. Additional features include overlay functionality, debug mode for development, and configurable cookie expiration periods.

The implementation handles browser compatibility through a dual-cookie approach, setting both a standard cookie and a legacy fallback cookie to ensure functionality across older browsers that lack support for the SameSite=None attribute. This technical solution is documented within the codebase and addresses real-world browser compatibility challenges.

Activity tracking through GitGenius shows that the repository maintains responsive issue and pull request handling, with a median response latency of 0.4 hours across tracked items. The primary maintainer, Mastermindzh, has driven the majority of development activity with 18 recorded events, while contributors Wiibleyde and GabeMeister have provided additional support. The most frequently encountered issues relate to bug reports and reproduction challenges. The repository's contributor network extends to major projects including Gatsby, Visual Studio Code, and Material-UI, indicating its integration within the broader React ecosystem.

The library is distributed through npm and includes TypeScript type definitions out of the box, making it accessible to both JavaScript and TypeScript projects. The MIT license permits broad usage and modification. The component supports accessibility features through customizable ARIA labels for buttons, and developers can hook into the consent flow through callback functions that execute when users accept or decline cookies. The extensive prop system allows fine-grained control over appearance and behavior without requiring deep component modifications, making it suitable for projects with varying design requirements and compliance needs.

react-cookie-consent
by
MastermindzhMastermindzh/react-cookie-consent

Repository Details

Fetching additional details & charts...