Skip to content

Instantly share code, notes, and snippets.

@peterbrinck
Created April 3, 2020 06:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterbrinck/2a5fa9a5e2b5244ab3bcc52dd4a016d6 to your computer and use it in GitHub Desktop.
Save peterbrinck/2a5fa9a5e2b5244ab3bcc52dd4a016d6 to your computer and use it in GitHub Desktop.
Simple cookie-banner with AlpineJS - original by @lepikhinb
<div x-data="{ show: !localStorage.getItem('hide-banner')}">
<div x-show="show">
<button type="button" @click="localStorage.setItem('hide-banner', true); show = false;">
OK!
</button>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment