6.0.3 โข Published 23 days ago
react-cookienotice v6.0.3
react-cookienotice
A lightweight & customizable cookie banner for your React App
- ๐ No dependency, full self-made package (1.4 kB - BundlePhobia)
- ๐ฑ Mobile first & responsive
- โ๏ธ Customizable with several props
- ๐ Very fast setup (less than 1 minute)
- ๐งช Tested with functionals tests
- ๐ Dark mode based on system settings
- ๐ Translated in French & English (create issue for more languages)
Install
Yarn
yarn add react-cookienotice
npm
npm i --save react-cookienotice
Usage
import React from 'react'
import CookieNotice from 'react-cookienotice'
import 'react-cookienotice/dist/index.css'
const Example = () => <CookieNotice />
export default Example
Props
All props are optionals.
If you want a "Read More" link, you must set all of the following props:
readMoreLabel
readMoreLink
readMoreInNewTab
Key | Type | Description | Default value |
---|---|---|---|
acceptButtonLabel | string | The label for the accept button. | Accept |
onAcceptButtonClick | Function | A callback function to be called when the accept button is clicked. | - |
declineButtonLabel | string | The label for the decline button. | Decline |
onDeclineButtonClick | Function | A callback function to be called when the decline button is clicked. | - |
titleLabel | string | The title for the cookie banner. | Cookie consent |
descriptionLabel | string | The description for the cookie banner. | By clicking "Accept", you consent to our website's use of cookies to provide you with the most relevant experience by remembering your cookie preferences. |
readMoreLabel | string | The label for the read more link. | - |
readMoreLink | string | The link for the read more label. | - |
readMoreInNewTab | boolean | Whether the read more link should open in a new tab. | - |
hideDeclineButton | boolean | This will hide the decline button. | - |
cookieExpiration | number | Days after cookie expires and user should reaccept cookies. | 30 |
cookieName | string | The name of the cookie that saves the user consent. | hide-notice |
License
MIT ยฉ xavierbriole
7.0.0-beta.3
23 days ago
7.0.0-beta.2
25 days ago
7.0.0-beta.1
1 month ago
7.0.0-beta.0
1 month ago
6.0.0-beta.7
11 months ago
6.0.1
11 months ago
6.0.0
11 months ago
6.0.3
8 months ago
6.0.2
11 months ago
6.0.0-beta.3
1 year ago
6.0.0-beta.4
1 year ago
6.0.0-beta.5
12 months ago
6.0.0-beta.1
1 year ago
6.0.0-beta.2
1 year ago
5.4.0
2 years ago
5.3.1
2 years ago
5.3.0
2 years ago
5.2.0
2 years ago
5.1.0
2 years ago
5.0.1
2 years ago
5.0.0
2 years ago
4.1.0
2 years ago
4.3.0
2 years ago
4.2.0
2 years ago
4.0.0
3 years ago
3.8.0
3 years ago
3.7.0
3 years ago
3.6.0
3 years ago
3.5.0
3 years ago
3.4.0
4 years ago
3.3.0
4 years ago
3.2.0
4 years ago
3.1.0
4 years ago
3.0.1
4 years ago
3.0.0
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.0
4 years ago
1.1.0
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago