Skip to content

Cookie Banner

A dismissible banner. Any element inside it with data-cookie-dismiss hides it and remembers the dismissal in localStorage; it renders and is usable without JavaScript, it just won’t remember the dismissal.

The preview below uses placement="static" so it stays inside this box; the default placement="bottom" fixes it to the bottom of the real browser viewport instead.

  • placement: bottom (default, fixed to the viewport), static
  • id: optional; distinguishes multiple banners in localStorage
<CookieBanner>
<p>We use cookies to improve your experience.</p>
<Button data-cookie-dismiss>Accept</Button>
</CookieBanner>