diff --git a/packages/cookie-banner/README.md b/packages/cookie-banner/README.md index a60bb032d..51ab359e7 100644 --- a/packages/cookie-banner/README.md +++ b/packages/cookie-banner/README.md @@ -8,219 +8,21 @@ A lightweight, GDPR-compliant cookie consent banner for the web. Works with any npm install @probo/cookie-banner ``` -## Quick Start (Script Tag) - -The fastest way to add a cookie banner to any website. Drop a single ` ``` -This automatically renders a fully styled consent dialog and a floating settings button so visitors can change their preferences at any time. +## Documentation -| Attribute | Required | Description | -| ---------------- | -------- | ----------------------------------------------------------------- | -| `data-banner-id` | Yes | Your banner ID from the Probo dashboard | -| `data-base-url` | Yes | The Probo cookie-banner API base URL | -| `data-position` | No | Settings button position: `bottom-left` (default), `bottom-right` | +Full documentation — including theming, headless components, and script blocking — is available at: -## Themed Banner (ES Module) - -Import the pre-built themed banner as an ES module for use in bundled applications (React, Vue, Svelte, etc.): - -```js -import { registerThemedBanner } from "@probo/cookie-banner"; - -registerThemedBanner(); -``` - -Then use the `` custom element anywhere in your HTML or templates: - -```html - -``` - -### Theming with CSS Custom Properties - -The themed banner renders inside a Shadow DOM and exposes CSS custom properties for styling: - -```css -probo-cookie-banner { - --probo-font-family: "Inter", sans-serif; - --probo-bg: #ffffff; - --probo-text: #1a1a1a; - --probo-text-secondary: #555555; - --probo-border: #e0e0e0; - --probo-radius: 12px; - --probo-shadow: 0 4px 24px rgba(0, 0, 0, 0.12); - --probo-accent: #1a1a1a; - --probo-accent-text: #ffffff; - --probo-overlay: rgba(0, 0, 0, 0.4); - --probo-z-index: 2147483646; - --probo-btn-radius: 8px; - --probo-font-size: 14px; -} -``` - -Dark mode example: - -```css -@media (prefers-color-scheme: dark) { - probo-cookie-banner { - --probo-bg: #1a1a1a; - --probo-text: #f0f0f0; - --probo-text-secondary: #a0a0a0; - --probo-border: #333333; - --probo-accent: #f0f0f0; - --probo-accent-text: #1a1a1a; - --probo-overlay: rgba(0, 0, 0, 0.6); - } -} -``` - -## Headless Components (Full Control) - -For complete control over the UI, import the headless Web Components directly. This entrypoint gives you unstyled building blocks that you compose and style yourself: - -```js -import { registerComponents } from "@probo/cookie-banner/headless"; - -registerComponents(); -``` - -Then build your own banner layout using the provided custom elements: - -```html - - - -
-

We use cookies to improve your experience.

- - - - - - - - - -
-
- - - -
- - - - - - -
-
- - - -
-``` - -### Available Components - -| Component | Description | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | -| `` | Root element. Requires `banner-id` and `base-url` attributes. Manages client lifecycle and state. | -| `` | Container shown when consent has not been given yet. | -| `` | Wraps a button that records "accept all" consent. | -| `` | Wraps a button that records "reject all" consent. | -| `` | Wraps a button that opens the preference panel. | -| `` | Container for per-category consent toggles. | -| `` | Renders a `