Skip to content

Persistent alert for users to acknowledge use of cookies (or whatever really) on a site.

Notifications You must be signed in to change notification settings

punkave/pk-cookie-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍪 🚨

pk-cookie-alert

A bundle that adds a global alert to a site that, once dismissed, won't reappear (unless cookies are cleared). includes a pk-cookie-alert-global module in addition to the root pk-cookie-alert module.

Configuration

Basic set up:

//in app.js
...
  modules: {
    ...
    'pk-cookie-alert': {},
    'pk-cookie-alert-global': {}
    ...
  }
...

Alert gets prepended to the body automatically.

Configuring the base module

You can configure your own base class name and cookie name for project-level overrides (optional)

//in app.js
...
  modules: {
    ...
    'pk-cookie-alert': {
      baseClass: 'my-class',
      cookieName: 'my-cookie'
    },
    'pk-cookie-alert-global': {}
    ...
  }
...

Configuring rich text

You can pass in your own rich text configuration for the global pkAlertText field via a richTextConfig option:

//in app.js
...
  modules: {
    ...
    'pk-cookie-alert': {},
    'pk-cookie-alert-global': {
      richTextConfig: { toolbar: [ 'Bold', 'Link', 'Unlink' ] }
    }
    ...
  }
...

About

Persistent alert for users to acknowledge use of cookies (or whatever really) on a site.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •