https://github.com/origenstudio/material-ui-cookie-consent
Allow cookies in your site with style! Material style! :sunglasses:
https://github.com/origenstudio/material-ui-cookie-consent
cookies javascript material-design material-ui react
Last synced: about 2 months ago
JSON representation
Allow cookies in your site with style! Material style! :sunglasses:
- Host: GitHub
- URL: https://github.com/origenstudio/material-ui-cookie-consent
- Owner: OrigenStudio
- License: mit
- Created: 2019-02-16T20:08:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T23:14:09.000Z (over 2 years ago)
- Last Synced: 2025-04-07T23:19:58.498Z (about 2 months ago)
- Topics: cookies, javascript, material-design, material-ui, react
- Language: JavaScript
- Homepage: https://material-ui-cookie-consent.origen.studio
- Size: 6.43 MB
- Stars: 17
- Watchers: 2
- Forks: 6
- Open Issues: 50
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Material-UI Cookie Consent
Material-UI component that show a cookie consent message.
## Example
Check this [example site](https://material-ui-cookie-consent.origen.studio)
## Dependencies
This package has the following peer dependencies that need to be installed manually:
```json
{
"@material-ui/core": "^4.0.1",
"react": "^16.8.6",
"react-dom": "^16.8.6"
}
```## Installation
```sh
yarn add material-ui-cookie-consent
```or
```sh
npm install material-ui-cookie-consent
```## Usage - Simple example
```js
import MUICookieConsent from 'material-ui-cookie-consent';// ....
//....
```## API
#### Table of Contents
- [MUICookieConsent](#muicookieconsent)
- [Parameters](#parameters)
- [handleScroll](#handlescroll)
- [handleAccept](#handleaccept)### MUICookieConsent
**Extends React.Component**
This component is the MUICookieConsent it pops a Snackbar or a Dialog informing the user about cookie consent.
#### Parameters
- `props` **Props**
#### handleScroll
checks whether scroll has exceeded set amount and fire accept if so.
#### handleAccept
Set a persistent cookie