2025-11-30 21:22:51 +00:00
# @consent.software/catalog
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
A sleek, modern library of web components for seamless consent management integration. Built with Lit and designed for GDPR/CCPA compliance out of the box.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
## Issue Reporting and Security
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/ ](https://community.foss.global/ ). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/ ](https://code.foss.global/ ) account to submit Pull Requests directly.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
## Features
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
🍪 **Cookie Consent Modal ** - Beautiful, responsive consent dialog with light/dark theme support
🎛️ **Interactive Toggles ** - Draggable toggle switches with smooth animations
📱 **Mobile-First Design ** - Fully responsive across all device sizes
🎨 **Theme-Aware ** - Automatically detects system light/dark mode preference
🔒 **Privacy-First ** - Integrates with consent.software backend for compliant consent tracking
⚡ **Zero Config ** - Drop-in components that just work
2025-01-09 00:43:01 +01:00
2025-11-30 21:22:51 +00:00
## Installation
2025-01-09 00:43:01 +01:00
2025-11-30 21:22:51 +00:00
```bash
npm install @consent .software/catalog
# or
pnpm add @consent .software/catalog
```
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
## Quick Start
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
Import the components and add the consent banner to your page:
2025-01-09 00:44:17 +01:00
```typescript
2025-11-30 21:22:51 +00:00
import '@consent .software/catalog';
// That's it! Add the component to your HTML
```
```html
<consentsoftware-cookieconsent></consentsoftware-cookieconsent>
2025-01-09 00:44:17 +01:00
```
2025-11-30 21:22:51 +00:00
The consent banner automatically:
- Shows on first visit when no consent preferences are stored
- Hides after user makes a selection
- Respects system dark/light mode
- Stores preferences via the consent.software backend
## Components
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
### `<consentsoftware-cookieconsent>`
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
The main consent modal component. Provides a full-screen overlay with cookie preference options.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
```html
<consentsoftware-cookieconsent></consentsoftware-cookieconsent>
```
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
**Features:**
- Three-button interface: Deny, Accept Selection, Accept All
- Four cookie categories: Required, Preferences, Statistics, Marketing
- Animated modal with backdrop blur
- Shake feedback when clicking outside the modal
- Automatic theme detection (light/dark)
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
### `<consentsoftware-toggle>`
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
A draggable toggle switch component with touch support.
```html
<consentsoftware-toggle>Label Text</consentsoftware-toggle>
<consentsoftware-toggle required>Required</consentsoftware-toggle>
2025-01-09 00:44:17 +01:00
```
2025-11-30 21:22:51 +00:00
**Properties:**
- `required` (boolean) - When true, toggle is locked in the "on" position
- `selected` (boolean) - Current toggle state
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
**Events:**
- `toggle` - Fired when state changes, includes `{ selected: boolean }` in detail
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
### `<consentsoftware-tabs>`
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
Tab navigation component with animated indicator.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
```html
<consentsoftware-tabs></consentsoftware-tabs>
2025-01-09 00:44:17 +01:00
```
2025-11-30 21:22:51 +00:00
Displays three tabs: Consent, Details, and Cookie Policy.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
### `<consentsoftware-header>`
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
Simple header component for the consent modal.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
```html
<consentsoftware-header></consentsoftware-header>
2025-01-09 00:44:17 +01:00
```
2025-11-30 21:22:51 +00:00
### `<consentsoftware-mainselection>`
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
Grid layout containing toggle switches for each cookie category.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
```html
<consentsoftware-mainselection></consentsoftware-mainselection>
```
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
## Backend Integration
This catalog integrates with the `@consent.software/webclient` package for backend communication:
2025-01-09 00:44:17 +01:00
```typescript
2025-11-30 21:22:51 +00:00
import { CsWebclient } from '@consent .software/webclient';
const client = new CsWebclient();
// Check current consent levels
const levels = await client.getCookieLevels();
if (!levels) {
// Show consent dialog
2025-01-09 00:44:17 +01:00
}
2025-11-30 21:22:51 +00:00
// Set consent levels programmatically
await client.setCookieLevels(['functional', 'analytics']);
// Run consent-dependent scripts
await client.getAndRunConsentTuples();
2025-01-09 00:44:17 +01:00
```
2025-11-30 21:22:51 +00:00
## Styling & Theming
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
The components use CSS custom properties for easy theming:
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
```css
consentsoftware-cookieconsent {
/* Text and colors */
--text-color: #333 ;
--background-color: #eeeeee ;
--accent-color: #333333 ;
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
/* Buttons */
--button-bg: #ffffff ;
--button-hover-bg: #f2f2f2 ;
/* Links */
--link-color: #333 ;
--icon-color: #4496f5 ;
/* Modal */
--modal-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
--info-bg: rgba(0, 0, 0, 0.1);
--info-text: rgba(0, 0, 0, 0.5);
2025-01-09 00:44:17 +01:00
}
```
2025-11-30 21:22:51 +00:00
The component automatically switches to dark theme variables when `theme="dark"` is set or when the system prefers dark mode.
## Cookie Levels
The consent system uses three user-selectable levels plus a required baseline:
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
| Level | Description |
|-------|-------------|
| `functional` | Required cookies for site operation (always enabled) |
| `preferences` | User preference cookies |
| `analytics` | Statistics and analytics tracking |
| `marketing` | Marketing and advertising cookies |
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
## Browser Support
- Chrome (last 2 versions)
- Firefox (last 2 versions)
- Safari (last 2 versions)
- Edge (last 2 versions)
Built with modern ES modules and requires browsers with native Custom Elements v1 support.
## Development
```bash
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Watch mode for development
pnpm run watch
```
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
## License and Legal Information
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE ](./LICENSE ) file.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
### Trademarks
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
### Company Information
2025-01-09 00:44:17 +01:00
2025-11-30 21:22:51 +00:00
Task Venture Capital GmbH
Registered at District Court Bremen HRB 35230 HB, Germany
2025-01-09 00:43:01 +01:00
2025-11-30 21:22:51 +00:00
For any legal inquiries or further information, please contact us via email at hello@task .vc.
2025-01-09 00:43:01 +01:00
2025-11-30 21:22:51 +00:00
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.