Skip to content

Instantly share code, notes, and snippets.

@pryley
Created August 30, 2020 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pryley/306f77a1bdbe8b90e158fd9de10d216f to your computer and use it in GitHub Desktop.
Save pryley/306f77a1bdbe8b90e158fd9de10d216f to your computer and use it in GitHub Desktop.
alpinejs close popup
<div x-data="{ show: !localStorage.getItem('hide-popup') }">
<div x-show="show">
<button @click="localStorage.setItem('hide-popup', true); show = false">
close
</button>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment