Installations
npm install @palmabit/react-cookie-law
Score
33.6
Supply Chain
84.8
Quality
80.6
Maintenance
50
Vulnerability
87.6
License
Releases
Unable to fetch releases
Developer
Palmabit-IT
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
12.13.0
NPM Version
6.12.0
Statistics
115 Stars
99 Commits
55 Forks
5 Watching
10 Branches
7 Contributors
Updated on 01 Oct 2024
Bundle Size
44.38 kB
Minified
13.88 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
245,891
Last day
45.7%
134
Compared to previous day
Last week
8.6%
554
Compared to previous week
Last month
-3.4%
2,252
Compared to previous month
Last year
-31.8%
35,229
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
5
Peer Dependencies
1
Dev Dependencies
25
React Cookie Law
A React Cookie Banner component GDPR compliance.
Install
yarn add @palmabit/react-cookie-law
or
npm install --save @palmabit/react-cookie-law
Usage
1import { CookieBanner } from "@palmabit/react-cookie-law"; 2 3React.renderComponent( 4 <div> 5 <CookieBanner 6 message="Cookie banner message" 7 wholeDomain={true} 8 onAccept={() => {}} 9 onAcceptPreferences={() => {}} 10 onAcceptStatistics={() => {}} 11 onAcceptMarketing={() => {}} 12 /> 13 </div>, 14 15 document.body 16);
Options
Name | Type | Default | Description |
---|---|---|---|
className | string | optional. Classes | |
message | string | Required. Custom text of the banner | |
wholeDomain | bool | false | optional. Enable or disable the root path '/' option when a cookie is set |
policyLink | string | "/#" | optional. Link to privacy policy page |
privacyPolicyLinkText | string | "Privacy Policy" | optional. Text for the privacy policy link |
necessaryOptionText | string | "Necessary" | optional. Text for the necessary cookies checkbox |
preferencesOptionText | string | "Preferences" | optional. Text for the preferences cookies checkbox |
statisticsOptionText | string | "Statistics" | optional. Text for the statistics cookies checkbox |
marketingOptionText | string | "Marketing" | optional. Text for the marketing cookies checkbox |
acceptButtonText | string | "Accept" | optional. Text for the accept button |
declineButtonText | string | "Decline" | optional. Text for the decline button |
managePreferencesButtonText | string | "Decline" | optional. Text for the manage preferences button |
savePreferencesButtonText | string | "Decline" | optional. Text for the save and close* button |
showDeclineButton | bool | false | optional. Show or hide the decline button |
dismissOnScroll | bool | false | optional. Enable or disable the dismissing on scroll of the banner |
showPreferencesOption | bool | true | optional. Show or hide the preferences checkbox |
showStatisticsOption | bool | true | optional. Show or hide the statistics checkbox |
showMarketingOption | bool | true | optional. Show or hide the marketing checkbox |
preferencesDefaultChecked | bool | true | optional. Check the preferences checkbox as default |
statisticsDefaultChecked | bool | true | optional. Check the statistics checkbox as default |
marketingDefaultChecked | bool | true | optional. Check the marketing checkbox as default |
onAccept | function | Function | optional. Callback called when the consent is given |
onAcceptPreferences | function | Function | optional. Callback called if preferences cookies is accepted |
onAcceptStatistics | function | Function | optional. Callback called if statistics cookies is accepted |
onAcceptMarketing | function | Function | optional. Callback called if marketing cookies is accepted |
onDeclinePreferences | function | Function | optional. Callback called if preferences cookies is declined |
onDeclineStatistics | function | Function | optional. Callback called if statistics cookies is declined |
onDeclineMarketing | function | Function | optional. Callback called if marketing cookies is declined |
coryphaUserId | string | "1" | optional. User ID of the current user |
coryphaDocumentCode | string | "my-app" | *optional**. The unique document code assigned to the application |
coryphaDocumentLanguage | string | "en" | *optional**. Callback called if *marketing* cookies is declined |
coryphaApiKey | string | "12345678-abcd-dcba-abcd-1234567890ab" | *optional**. Your Corypha API Key |
onAcceptCoryphaPreferences | function | Function | optional. Callback called when Corypha cookies are accepted |
onDeclineCoryphaPreferences | function | Function | optional. Callback called when Corypha cookies are declined |
*NOTE: coryphaDocumentCode, coryphaDocumentLanguage and coryphaApiKey are required when setting up the Corypha integration.
Style
1<CookieBanner 2 message="Cookie banner message" 3 styles={{ 4 dialog: { backgroundColor: "red" }, 5 }} 6/>
Style option | Description |
---|---|
dialog | Style that override .react-cookie-law-dialog class |
container | .react-cookie-law-container class |
message | Style for banner text (.react-cookie-law-message class) |
policy | Style for cookie policy link (.react-cookie-law-policy class) |
selectPane | Style for select pane (.react-cookie-law-select-pane class) |
optionWrapper | Style for option checkbox wrapper (.react-cookie-law-option-wrapper class) |
optionLabel | Style for the text of checkbox labels |
checkbox | Style for checkboxes (.react-cookie-law-option-checkbox class) |
buttonWrapper | Style for buttons wrapper (.react-cookie-law-dialog class) |
button | Style for buttons (.react-cookie-law-dialog class) |
Test
yarn test
or
npm test
Author
Licence
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 18 are checked with a SAST tool
Reason
23 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-q8pj-2vqx-8ggc
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
1.3
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More