6.0.3 โ€ข Published 23 days ago

react-cookienotice v6.0.3

Weekly downloads
60
License
MIT
Repository
github
Last release
23 days ago

react-cookienotice

A lightweight & customizable cookie banner for your React App

Preview Light

NPM JavaScript Style Guide codecov npm-publish downloads storybook

  • ๐Ÿƒ 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
KeyTypeDescriptionDefault value
acceptButtonLabelstringThe label for the accept button.Accept
onAcceptButtonClickFunctionA callback function to be called when the accept button is clicked.-
declineButtonLabelstringThe label for the decline button.Decline
onDeclineButtonClickFunctionA callback function to be called when the decline button is clicked.-
titleLabelstringThe title for the cookie banner.Cookie consent
descriptionLabelstringThe 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.
readMoreLabelstringThe label for the read more link.-
readMoreLinkstringThe link for the read more label.-
readMoreInNewTabbooleanWhether the read more link should open in a new tab.-
hideDeclineButtonbooleanThis will hide the decline button.-
cookieExpirationnumberDays after cookie expires and user should reaccept cookies.30
cookieNamestringThe 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