Banner
Tailwind CSS and Alpine JS Banner
Simple banner
A simple banner with a text, link and a dismiss button.
Limited Time Offer! Explore exclusive deals & savings
HTML
<div class="">
<p class="">Limited Time Offer! Explore exclusive <a href="#" class="">deals & savings</a> </p>
<button class="" aria-label="dismiss banner">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" stroke="currentColor" fill="none" stroke-width="2.5" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
Banner with button
Get Fit Anywhere, Anytime 💪
HTML
<div class="">
<div class="">
<p class="">Get Fit Anywhere, Anytime 💪</p>
<button type="button" class="">Start free trial</button>
</div>
<button class="" aria-label="dismiss banner">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" stroke="currentColor" fill="none" stroke-width="2.5" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
Fixed banner
HTML
<div class="">
<p class="">Limited Time Offer! Explore exclusive <a href="#" class="">deals & savings</a> </p>
<button class="" aria-label="dismiss banner">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" stroke="currentColor" fill="none" stroke-width="2.5" class="">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
Cookie banner
Cookie Time!
We use cookies to make your experience sweet and crispy. For more information, please read our Privacy Policy.
HTML
<div class="">
<!-- Header -->
<div class="">
<h3 class="">
<span class="" aria-hidden="true">🍪</span>
Cookie Time!
</h3>
</div>
<!-- Body -->
<div class="">
<p class="">
We use cookies to make your experience sweet and crispy. For more information, please read our <a href="#" class="">Privacy Policy</a>
</p>
</div>
<!-- Footer -->
<div class="">
<button type="button" class="">No, thank you</button>
<button type="button" class="">Sounds Good!</button>
</div>
</div>
Keyboard Navigation
Key | Action |
---|---|
Tab |
Next focusable element gets the focus
|
Space Enter | Focused item gets selected |