svelte-tailwind-cookieconsent Svelte Themes

Svelte Tailwind Cookieconsent

A simple cookie consent banner, made with Svelte&Tailwind

Installation

npm install svelte-tailwind-cookieconsent

Usage

import CookieConsent from "svelte-tailwind-cookieconsent/src";

<CookieConsent 
    allowButtonText={"Allow"} 
    closeText={"Close"} 
    descriptionText={"We are using cookies to improve your experience  "} 
    cookiePolicyText={"Learn More"} 
    cookiePolicyUrl={"https://www.example.com/"} 
    bgColor={"bg-gray-200"} 
    buttonTextColor={"text-white"} 
    closeTextColor={"text-green-500"}
    buttonBgColor={"bg-green-500"} 
    descriptionTextColor={"text-gray-600"} 
/>

Notes

If you are purging unused tailwind classes, don't forget to exclude classes used in src/CookieConsent.svelte

Top categories

Loading Svelte Themes