{"id":28639637,"url":"https://github.com/palmabit-it/react-cookie-law","last_synced_at":"2025-06-12T19:41:03.380Z","repository":{"id":33152072,"uuid":"149037980","full_name":"Palmabit-IT/react-cookie-law","owner":"Palmabit-IT","description":"React Cookie Law is a cookie-info banner compliance with the GDPR and the EU cookie law. It allows the user to give consent in a granular way.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:50:59.000Z","size":1844,"stargazers_count":115,"open_issues_count":29,"forks_count":53,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-09T05:02:34.298Z","etag":null,"topics":["cookie","cookie-banner","cookie-consent","gdpr","gdpr-consent","gdpr-cookie","javascript","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Palmabit-IT.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-16T21:36:53.000Z","updated_at":"2025-03-16T13:28:01.000Z","dependencies_parsed_at":"2024-06-18T15:30:06.208Z","dependency_job_id":"c314fef0-ded4-4df6-a533-c1613ecb32e1","html_url":"https://github.com/Palmabit-IT/react-cookie-law","commit_stats":{"total_commits":72,"total_committers":13,"mean_commits":5.538461538461538,"dds":0.7083333333333333,"last_synced_commit":"39310eb4163b6f9c6af03271b38bf3765f5913c8"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Palmabit-IT/react-cookie-law","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmabit-IT%2Freact-cookie-law","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmabit-IT%2Freact-cookie-law/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmabit-IT%2Freact-cookie-law/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmabit-IT%2Freact-cookie-law/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Palmabit-IT","download_url":"https://codeload.github.com/Palmabit-IT/react-cookie-law/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmabit-IT%2Freact-cookie-law/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259520285,"owners_count":22870415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cookie","cookie-banner","cookie-consent","gdpr","gdpr-consent","gdpr-cookie","javascript","react"],"created_at":"2025-06-12T19:41:01.805Z","updated_at":"2025-06-12T19:41:03.362Z","avatar_url":"https://github.com/Palmabit-IT.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Cookie Law\n\n[![npm version](https://badge.fury.io/js/%40palmabit%2Freact-cookie-law.svg)](https://badge.fury.io/js/%40palmabit%2Freact-cookie-law) [![Build Status](https://travis-ci.org/Palmabit-IT/react-cookie-law.svg?branch=master)](https://travis-ci.org/Palmabit-IT/react-cookie-law) [![Coverage Status](https://coveralls.io/repos/github/Palmabit-IT/react-cookie-law/badge.svg?branch=master)](https://coveralls.io/github/Palmabit-IT/react-cookie-law?branch=master)\n\nA React Cookie Banner component GDPR compliance.\n\n![Preview](https://raw.githubusercontent.com/Palmabit-IT/react-cookie-law/master/banner_preview.png)\n\n## Install\n\n```\n\nyarn add @palmabit/react-cookie-law\n\n```\n\nor\n\n```\n\nnpm install --save @palmabit/react-cookie-law\n\n```\n\n## Usage\n\n```js\nimport { CookieBanner } from \"@palmabit/react-cookie-law\";\n\nReact.renderComponent(\n  \u003cdiv\u003e\n    \u003cCookieBanner\n      message=\"Cookie banner message\"\n      wholeDomain={true}\n      onAccept={() =\u003e {}}\n      onAcceptPreferences={() =\u003e {}}\n      onAcceptStatistics={() =\u003e {}}\n      onAcceptMarketing={() =\u003e {}}\n    /\u003e\n  \u003c/div\u003e,\n\n  document.body\n);\n```\n\n### Options\n\n|Name|Type|Default|Description|\n|----|----|-------|-----------|\n| **className** | string | | **optional**. Classes |\n| **message** | string | | **Required**. Custom text of the banner |\n| **wholeDomain** | bool | false | _optional_. Enable or disable the root path '/' option when a cookie is set |\n| **policyLink** | string | \"/#\" | _optional_. Link to privacy policy page |\n| **privacyPolicyLinkText** | string | \"Privacy Policy\" | _optional_. Text for the privacy policy link |\n| **necessaryOptionText** | string | \"Necessary\" | _optional_. Text for the _necessary_ cookies checkbox |\n| **preferencesOptionText** | string | \"Preferences\" | _optional_. Text for the _preferences_ cookies checkbox |\n| **statisticsOptionText** | string | \"Statistics\" | _optional_. Text for the _statistics_ cookies checkbox |\n| **marketingOptionText** | string | \"Marketing\" | _optional_. Text for the _marketing_ cookies checkbox |\n| **acceptButtonText** | string | \"Accept\" | _optional_. Text for the _accept_ button |\n| **declineButtonText** | string | \"Decline\" | _optional_. Text for the _decline_ button |\n| **managePreferencesButtonText** | string | \"Decline\" | _optional_. Text for the _manage preferences_ button |\n| **savePreferencesButtonText** | string | \"Decline\" | _optional_. Text for the save and close\\* button |\n| **showDeclineButton** | bool | false | _optional_. Show or hide the _decline_ button |\n| **dismissOnScroll** | bool | false | _optional_. Enable or disable the dismissing on scroll of the banner |\n| **showPreferencesOption** | bool | true | _optional_. Show or hide the _preferences_ checkbox |\n| **showStatisticsOption** | bool | true | _optional_. Show or hide the _statistics_ checkbox |\n| **showMarketingOption** | bool | true | _optional_. Show or hide the _marketing_ checkbox |\n| **preferencesDefaultChecked** | bool | true | _optional_. Check the _preferences_ checkbox as default |\n| **statisticsDefaultChecked** | bool | true | _optional_. Check the _statistics_ checkbox as default |\n| **marketingDefaultChecked** | bool | true | _optional_. Check the _marketing_ checkbox as default |\n| **onAccept** | function | Function | _optional_. Callback called when the consent is given |\n| **onAcceptPreferences** | function | Function | _optional_. Callback called if _preferences_ cookies is accepted |\n| **onAcceptStatistics** | function | Function | _optional_. Callback called if _statistics_ cookies is accepted |\n| **onAcceptMarketing** | function | Function | _optional_. Callback called if _marketing_ cookies is accepted |\n| **onDeclinePreferences** | function | Function | _optional_. Callback called if _preferences_ cookies is declined |\n| **onDeclineStatistics** | function | Function | _optional_. Callback called if _statistics_ cookies is declined |\n| **onDeclineMarketing** | function | Function | _optional_. Callback called if _marketing_ cookies is declined |\n| **coryphaUserId** | string | \"1\" | _optional_. User ID of the current user |\n| **coryphaDocumentCode** | string | \"my-app\" | \\*optional\\*\\*. The unique document code assigned to the application |\n| **coryphaDocumentLanguage** | string | \"en\" | *optional\\*\\*. Callback called if *marketing\\* cookies is declined |\n| **coryphaApiKey** | string | \"12345678-abcd-dcba-abcd-1234567890ab\" | \\*optional\\*\\*. Your Corypha API Key |\n| **onAcceptCoryphaPreferences** | function | Function | _optional_. Callback called when Corypha cookies are accepted |\n| **onDeclineCoryphaPreferences** | function | Function | _optional_. Callback called when Corypha cookies are declined |\n\n**\\*NOTE:** _coryphaDocumentCode_, _coryphaDocumentLanguage_ and _coryphaApiKey_ are required when setting up the Corypha integration.\n\n## Style\n\n```js\n\u003cCookieBanner\n  message=\"Cookie banner message\"\n  styles={{\n    dialog: { backgroundColor: \"red\" },\n  }}\n/\u003e\n```\n\n|Style option|Description|\n|----|----|\n| **dialog** | Style that override `.react-cookie-law-dialog` class |\n| **container** | `.react-cookie-law-container` class |\n| **message** | Style for banner text (`.react-cookie-law-message` class) |\n| **policy** | Style for cookie policy link (`.react-cookie-law-policy` class) |\n| **selectPane** | Style for select pane (`.react-cookie-law-select-pane` class) |\n| **optionWrapper** | Style for option checkbox wrapper (`.react-cookie-law-option-wrapper` class) |\n| **optionLabel** | Style for the text of checkbox labels |\n| **checkbox** | Style for checkboxes (`.react-cookie-law-option-checkbox` class) |\n| **buttonWrapper** | Style for buttons wrapper (`.react-cookie-law-dialog` class) |\n| **button** | Style for buttons (`.react-cookie-law-dialog` class) |\n\n## Test\n\n```\n\nyarn test\n\n```\n\nor\n\n```\n\nnpm test\n\n```\n\n# Author\n\n[Palmabit](https://www.palmabit.com)\n\n# Licence\n\n[See the MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalmabit-it%2Freact-cookie-law","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalmabit-it%2Freact-cookie-law","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalmabit-it%2Freact-cookie-law/lists"}