@cuban-engineer/react-cookies-consent

React component for the managing the user awareness regarding cookies usage

Showing:

Popularity

Downloads/wk

2

GitHub Stars

2

Maintenance

Last Commit

3yrs ago

Contributors

0

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

Yes?

Readme

@cuban-engineer/react-cookies-consent

code style: prettier code linting: eslint code quality: jest MIT license

React component for the managing the user awareness regarding cookies usage

Install

npm install --save @cuban-engineer/react-cookies-consent

or

yarn add @cuban-engineer/react-cookies-consent

Usage

import React, { Component } from 'react'

import CookiesConsent from '@cuban-engineer/react-cookies-consent'

class Example extends Component {
  render () {
    return (
      <CookiesConsent />
    )
  }
}

Available props

  • cookiesId Value with which the cookie will be save in the browser: (Type: String, Default value: 'cookies-consent')
  • message Message that will be show to the user: (Type String, Default value: 'Cookies help us deliver our services. By using our services, you agree to our use of cookies.')
  • buttonMessage Text of the submit action button: (Type: String, Default value: 'OK')
  • expiresIn Time needed for the cookie to expire: (Type: Number, Default value: 365)
  • link Link for more information pages: (Type: Object, Default values: { url: undefined, text: undefined, target: '_blank'})

Styling

By default the rendered component will be fixed at the bottom and will look like this:

React Cookies Consent Component

But the styles can be modified by overriding this css classes:

  1. .cookies-consent: Entire Component container.
  2. .cookies-consent-text: Container of the message showed to the user.
  3. .cookies-consent-button Container of the Button for accepting the use of cookies.
  4. .cookies-consent-link Container of the a tag for the link.

License

@cuban-engineer/react-cookies-consent is MIT-licensed.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Tutorials

No tutorials found
Add a tutorial