Announcement Bar: Promo with Close
Minimal, full-width promo bar with a discount code, short message, and a close button.
npx shadcn@latest add https://tailkits.com/r/free-announcement-bar-1.jsonView HTML code
<section class="bg-tk-surface-2 py-2">
<div
class="max-w-7xl mx-auto px-4 xl:px-0 flex items-center justify-between gap-x-2"
>
<div
class="flex w-full grow items-center gap-x-2 justify-self-center md:justify-center"
>
<div
class="items-center justify-center rounded-full text-sm font-medium whitespace-nowrap shadow-tk-md inline-flex bg-primary text-primary-foreground px-2 py-0.5"
>
<svg
class="h-3 shrink-0 mr-1.5 text-tk-primary-foreground-muted"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
aria-hidden="true"
data-slot="icon"
>
<path
fill-rule="evenodd"
d="M14.615 1.595a.75.75 0 0 1 .359.852L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262l-10.5 11.25a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262l10.5-11.25a.75.75 0 0 1 .913-.143Z"
clip-rule="evenodd"
/>
</svg>
PH10
</div>
<div class="text-sm font-medium text-card-foreground">
Enjoy exclusive discounts
</div>
</div>
<button
data-tk-hover="press"
class="flex h-6 w-6 cursor-pointer items-center justify-center rounded-tk-3xl bg-tk-fill p-1 transition hover:bg-tk-fill-strong"
type="button"
aria-label="Close bar"
>
<svg
class="h-4 text-muted-foreground"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
aria-hidden="true"
data-slot="icon"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M6 18 18 6M6 6l12 12"
/>
</svg>
</button>
</div>
</section>