klintan / react-cookienotice

An awesome cookie banner for your website

Home Page:https://xavierbriole.github.io/react-cookienotice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-cookienotice

An awesome cookie banner for your website

Preview Light Preview Dark

NPM JavaScript Style Guide codecov npm-publish downloads

Live preview

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

About

An awesome cookie banner for your website

https://xavierbriole.github.io/react-cookienotice


Languages

Language:JavaScript 94.2%Language:HTML 4.6%Language:CSS 1.2%