Home Work
SaaS developmentAI developmentAPI developmentMobile app developmentGoogle Ads managementHeadless ShopifyLaravel developmentNext.js developmentReact developmentTypeScript engineeringUI/UX designSEO & AEOEcommerce development
AI solutionsB2B platformsE-commerceHospitalityLead generationLogisticsEducationProcess automationSaaS platformsStartup MVPReal estateHealthcare
LegalHealthcareReal estateFinanceHospitality
The HagueRotterdamAmsterdamUtrechtEindhovenAlmereBredaArnhemNijmegenTilburgEnschedeGroningenLeidenDelftZoetermeerDen Bosch
Studio
AboutProcessLabBlogContact

Sluitknop met animatie New

A close button for notices and banners: on hover or focus the cross turns a quarter and a frame draws around it (SVG stroke-dashoffset); on click the cross shrinks and the notice collapses smoothly via grid-template-rows. Focus then moves to a logical place, Escape closes too. For closing days, cookie or service notices and temporary promotions; with reduced motion the notice disappears without animation.

Kerst: aangepaste openingstijden. Op 25 en 26 december is de werkplaats in Amersfoort dicht. Spoed met lekkage? Bel 033 123 4567.

How to use it

  1. Paste the HTML where the buttons should appear.
  2. Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
  3. Add the JavaScript and call init() with the element that contains the HTML.
<!-- Sluitknop met animatie · NedDev · eigen werk. -->
<div class="jouw-container">
<div class="ksl">
<div class="ksl__wrap">
<div class="ksl__in">
<div class="ksl__card" role="region" aria-label="Melding openingstijden">
<p class="ksl__t"><strong>Kerst: aangepaste openingstijden.</strong> Op 25 en 26 december is de werkplaats in Amersfoort dicht. Spoed met lekkage? Bel 033 123 4567.</p>
<button class="ksl__x" type="button" aria-label="Melding sluiten"><svg viewBox="0 0 40 40" aria-hidden="true"><rect class="ksl__ring" x="1.5" y="1.5" width="37" height="37" rx="4" pathLength="100"/><g class="ksl__cross"><path d="M14 14l12 12"/><path d="M26 14L14 26"/></g></svg></button>
</div>
</div>
</div>
<button class="ksl__back" type="button" hidden>Melding weer tonen</button>
</div>
</div>

More buttons

Seen something you like?

Add it to your selection and send it over. We build your site around it, in your brand.

Get in touch →