
Shadcn Cookies
A sleek and flexible cookie consent component for shadcn/ui, simplifying user cookie preference management with multiple variants and callbacks.

shadcn/ui Cookies: Elegant Cookie Consent for Your Application
shadcn/ui cookies provides a refined and adaptable cookie consent component, specifically engineered for effortless integration with applications using shadcn/ui. It enables developers to implement clear cookie consent banners, crucial for user privacy and regulatory compliance. The component is designed for easy installation and offers distinct visual variants, ensuring a seamless fit into various web designs while simplifying a key aspect of modern web development for user transparency.
Features:
- Multiple Variants: Choose from 'default', 'small', or 'minimal' variants to best fit your application's design and user experience strategy.
- Accept Callback Function: Execute custom JavaScript code (e.g., enabling analytics) when a user accepts cookies via the
onAcceptCallback
prop. - Decline Callback Function: Implement custom actions (e.g., maintaining minimal functionality) when a user declines cookies using the
onDeclineCallback
prop. - shadcn/ui Design: Built with shadcn/ui principles, ensuring a sleek and consistent look and feel within your shadcn/ui based application.
- Simple CLI Installation: Easily add the component to your project with a single
npx shadcn@latest add
command pointing to the component's JSON. - User-Friendly Consent UI: Provides a clear and accessible interface for users to understand cookie usage and make their consent choices.
Summary:
This tool is a React component for adding cookie consent functionality to shadcn/ui projects. It offers 'default', 'small', and 'minimal' visual styles, along with onAcceptCallback
and onDeclineCallback
for custom logic. Developers can quickly integrate this component using a CLI command, providing users with a clear way to manage cookie preferences, thereby enhancing both compliance and the overall user experience of the application.

Similar to Shadcn Cookies:


