react-cookienotice
An awesome cookie banner for your website
Install
Yarn
yarn add react-cookienotice
npm
npm i --save react-cookienotice
Usage
import * as React from 'react'
import CookieNotice from 'react-cookienotice'
class Example extends React.Component {
render() {
return <CookieNotice />
}
}
Props
All props are optionals
Key | Type | Description | Default value |
---|---|---|---|
acceptButtonLabel | string |
Edit the "Accept" button label | Accept |
readMoreButtonLabel | string |
Edit the "Read more" button label | Read more |
readMoreButtonLink | string |
Edit the "Read more" button link | http://aboutcookies.org/ |
openInNewTab | boolean |
Open the "Read more" button link in a new tab | true |
cookieTextLabel | string |
Main cookie notice label | This website uses cookies to improve your browsing experience. |
reverseButtons | boolean |
Reverse buttons direction | false |
borderRadius | number |
Cookie notice border radius (in px) | 32 |
justifyContent | string |
justify-content property for wrapper (space-around or space-between ) |
space-between |
maxWidth | number |
Maximum cookie notice width | 1000 |
cookieExpiration | number |
Days after cookie expires and user should reaccept cookies | 30 |
cookieName | string |
The name of the cookie that saves the user consent | allow-cookies |
darkTheme | boolean |
Enable dark theme | Auto |
displayIcon | boolean |
Display the icon | true |
License
MIT © xavierbriole