Makes tasty cookies for React.
yarn add cookie_toasterIn your root component:
import {CookieToaster} from 'cookie_toaster'
...
<CookieToaster />
...To modify the css you can use the following structure:
.cookie-toaster { // or cookie-toaster-modal, cookie-toaster-top
// topmost div
.cookie-container {
// inner content
h1{
// title css
}
p{
// text css
}
a{
// link css
}
button {
// button css
}
}
}- CookieToaster
- CookieToasterTop
- CookieToasterModal
- title: String, title (duh)
- text: String, content
- btnAcceptText: String, button label
- btnDeclineText: String, button label
- accept: function, callback to handle accept
- decline: function, callback to handle decline
- popped: Boolean, set this property in your localstorage to track if cookie has been shown for the user
- linkUrl: String, a url
- linkText: String, the text to display for the link