@c15t/nextjs 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/AGENTS.md +155 -0
  2. package/README.md +31 -15
  3. package/client/components/integrations.js +3 -0
  4. package/dist/components/integrations/index.cjs +1 -0
  5. package/dist/components/integrations/index.js +1 -0
  6. package/dist/headless.cjs +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/libs/browser-initial-data.cjs +1 -1
  9. package/dist/libs/initial-data.cjs +1 -1
  10. package/dist/styles.tw3.css +1 -1
  11. package/dist/version.cjs +1 -1
  12. package/dist/version.js +1 -1
  13. package/dist-types/components/integrations/index.d.ts +1 -0
  14. package/dist-types/libs/browser-initial-data.d.ts +1 -1
  15. package/dist-types/version.d.ts +1 -1
  16. package/docs/README.md +155 -73
  17. package/docs/{building-headless-components.md → frameworks/next/building-headless-components.md} +3 -1
  18. package/docs/{callbacks.md → frameworks/next/callbacks.md} +3 -1
  19. package/docs/{components → frameworks/next/components}/consent-banner.md +10 -21
  20. package/docs/{components → frameworks/next/components}/consent-dialog-link.md +8 -5
  21. package/docs/frameworks/next/components/consent-dialog-trigger.md +202 -0
  22. package/docs/{components → frameworks/next/components}/consent-dialog.md +7 -15
  23. package/docs/frameworks/next/components/consent-manager-provider.md +327 -0
  24. package/docs/{components → frameworks/next/components}/consent-widget.md +8 -6
  25. package/docs/{components → frameworks/next/components}/dev-tools.md +9 -6
  26. package/docs/{components → frameworks/next/components}/frame.md +8 -9
  27. package/docs/{concepts → frameworks/next/concepts}/client-modes.md +4 -2
  28. package/docs/{concepts → frameworks/next/concepts}/consent-categories.md +1 -0
  29. package/docs/{concepts → frameworks/next/concepts}/consent-models.md +1 -0
  30. package/docs/{concepts → frameworks/next/concepts}/cookie-management.md +3 -3
  31. package/docs/{concepts → frameworks/next/concepts}/glossary.md +1 -0
  32. package/docs/{concepts → frameworks/next/concepts}/initialization-flow.md +1 -0
  33. package/docs/{concepts → frameworks/next/concepts}/policy-packs.md +1 -0
  34. package/docs/{headless.md → frameworks/next/headless.md} +3 -1
  35. package/docs/{hooks → frameworks/next/hooks}/use-color-scheme.md +1 -0
  36. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/checking-consent.md +3 -1
  37. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/location-info.md +3 -1
  38. package/docs/frameworks/next/hooks/use-consent-manager/overview.md +185 -0
  39. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/setting-consent.md +3 -1
  40. package/docs/{hooks → frameworks/next/hooks}/use-draggable.md +3 -1
  41. package/docs/{hooks → frameworks/next/hooks}/use-focus-trap.md +1 -0
  42. package/docs/{hooks → frameworks/next/hooks}/use-reduced-motion.md +3 -1
  43. package/docs/{hooks → frameworks/next/hooks}/use-ssr-status.md +6 -5
  44. package/docs/{hooks → frameworks/next/hooks}/use-text-direction.md +1 -0
  45. package/docs/frameworks/next/hooks/use-translations.md +55 -0
  46. package/docs/{iab → frameworks/next/iab}/consent-banner.md +9 -12
  47. package/docs/{iab → frameworks/next/iab}/consent-dialog.md +9 -14
  48. package/docs/{iab → frameworks/next/iab}/overview.md +4 -2
  49. package/docs/{iab → frameworks/next/iab}/use-gvl-data.md +3 -2
  50. package/docs/{iframe-blocking.md → frameworks/next/iframe-blocking.md} +8 -9
  51. package/docs/{internationalization.md → frameworks/next/internationalization.md} +13 -3
  52. package/docs/{network-blocker.md → frameworks/next/network-blocker.md} +13 -51
  53. package/docs/{optimization.md → frameworks/next/optimization.md} +5 -4
  54. package/docs/{policy-packs.md → frameworks/next/policy-packs.md} +3 -1
  55. package/docs/{quickstart.md → frameworks/next/quickstart.md} +26 -42
  56. package/docs/{script-loader.md → frameworks/next/script-loader.md} +72 -90
  57. package/docs/{server-side.md → frameworks/next/server-side.md} +12 -15
  58. package/docs/{styling → frameworks/next/styling}/classnames.md +3 -1
  59. package/docs/{styling → frameworks/next/styling}/color-scheme.md +3 -1
  60. package/docs/frameworks/next/styling/css-variables.md +53 -0
  61. package/docs/frameworks/next/styling/overview.md +299 -0
  62. package/docs/frameworks/next/styling/slots.md +94 -0
  63. package/docs/{styling → frameworks/next/styling}/tailwind.md +3 -1
  64. package/docs/frameworks/next/styling/tokens.md +156 -0
  65. package/docs/{troubleshooting.md → frameworks/next/troubleshooting.md} +3 -1
  66. package/docs/integrations/adobe-analytics.md +160 -0
  67. package/docs/integrations/ahrefs-analytics.md +15 -82
  68. package/docs/integrations/amplitude.md +230 -0
  69. package/docs/integrations/building-integrations.md +15 -181
  70. package/docs/integrations/clearbit.md +130 -0
  71. package/docs/integrations/cloudflare-web-analytics.md +15 -83
  72. package/docs/integrations/crisp.md +13 -87
  73. package/docs/integrations/databuddy.md +16 -85
  74. package/docs/integrations/fathom-analytics.md +15 -86
  75. package/docs/integrations/google-maps.md +263 -0
  76. package/docs/integrations/google-tag-manager.md +18 -86
  77. package/docs/integrations/google-tag.md +15 -84
  78. package/docs/integrations/heap.md +219 -0
  79. package/docs/integrations/hightouch.md +199 -0
  80. package/docs/integrations/hotjar.md +15 -83
  81. package/docs/integrations/intercom.md +13 -83
  82. package/docs/integrations/linkedin-insights.md +15 -82
  83. package/docs/integrations/logrocket.md +175 -0
  84. package/docs/integrations/matomo-analytics.md +13 -88
  85. package/docs/integrations/meta-pixel.md +33 -316
  86. package/docs/integrations/microsoft-clarity.md +15 -83
  87. package/docs/integrations/microsoft-uet.md +16 -83
  88. package/docs/integrations/mixpanel-analytics.md +15 -83
  89. package/docs/integrations/overview.md +55 -6
  90. package/docs/integrations/pirsch.md +142 -0
  91. package/docs/integrations/plausible-analytics.md +14 -97
  92. package/docs/integrations/posthog.md +26 -98
  93. package/docs/integrations/promptwatch.md +16 -82
  94. package/docs/integrations/reddit-pixel.md +27 -122
  95. package/docs/integrations/rudderstack.md +271 -0
  96. package/docs/integrations/rybbit-analytics.md +15 -94
  97. package/docs/integrations/segment.md +15 -82
  98. package/docs/integrations/snapchat-pixel.md +21 -102
  99. package/docs/integrations/tiktok-pixel.md +13 -81
  100. package/docs/integrations/umami-analytics.md +16 -88
  101. package/docs/integrations/vercel-analytics.md +13 -85
  102. package/docs/integrations/x-pixel.md +27 -102
  103. package/docs/integrations/youtube.md +193 -0
  104. package/docs/shared/concepts/client-modes.md +103 -0
  105. package/docs/shared/concepts/consent-categories.md +41 -0
  106. package/docs/shared/concepts/consent-models.md +72 -0
  107. package/docs/shared/concepts/cookie-management.md +88 -0
  108. package/docs/shared/concepts/glossary.md +24 -0
  109. package/docs/shared/concepts/initialization-flow.md +105 -0
  110. package/docs/shared/concepts/policy-packs.md +225 -0
  111. package/docs/shared/react/components/consent-banner.md +242 -0
  112. package/docs/shared/react/components/consent-dialog-link.md +45 -0
  113. package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
  114. package/docs/shared/react/components/consent-dialog.md +119 -0
  115. package/docs/shared/react/components/consent-manager-provider.md +225 -0
  116. package/docs/shared/react/components/consent-widget.md +121 -0
  117. package/docs/shared/react/components/dev-tools.md +81 -0
  118. package/docs/shared/react/components/frame.md +52 -0
  119. package/docs/shared/react/guides/building-headless-components.md +110 -0
  120. package/docs/shared/react/guides/callbacks.md +89 -0
  121. package/docs/shared/react/guides/headless.md +31 -0
  122. package/docs/shared/react/guides/iframe-blocking.md +65 -0
  123. package/docs/shared/react/guides/internationalization.md +123 -0
  124. package/docs/shared/react/guides/network-blocker.md +72 -0
  125. package/docs/shared/react/guides/optimization.md +44 -0
  126. package/docs/shared/react/guides/policy-packs.md +173 -0
  127. package/docs/shared/react/guides/script-loader.md +311 -0
  128. package/docs/shared/react/hooks/use-color-scheme.md +31 -0
  129. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
  130. package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
  131. package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
  132. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
  133. package/docs/shared/react/hooks/use-draggable.md +30 -0
  134. package/docs/shared/react/hooks/use-focus-trap.md +20 -0
  135. package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
  136. package/docs/shared/react/hooks/use-ssr-status.md +16 -0
  137. package/docs/shared/react/hooks/use-text-direction.md +38 -0
  138. package/docs/shared/react/hooks/use-translations.md +15 -0
  139. package/docs/shared/react/iab/consent-banner.md +60 -0
  140. package/docs/shared/react/iab/consent-dialog.md +76 -0
  141. package/docs/shared/react/iab/overview.md +80 -0
  142. package/docs/shared/react/iab/use-gvl-data.md +21 -0
  143. package/docs/shared/react/styling/classnames.md +93 -0
  144. package/docs/shared/react/styling/color-scheme.md +35 -0
  145. package/docs/shared/react/styling/css-variables.md +53 -0
  146. package/docs/shared/react/styling/overview.md +261 -0
  147. package/docs/shared/react/styling/slots.md +93 -0
  148. package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
  149. package/docs/shared/react/styling/tailwind.md +88 -0
  150. package/docs/shared/react/styling/tokens.md +155 -0
  151. package/docs/shared/troubleshooting.md +82 -0
  152. package/package.json +19 -10
  153. package/readme.json +14 -8
  154. package/docs/ai-agents.md +0 -111
  155. package/docs/components/consent-dialog-trigger.md +0 -103
  156. package/docs/components/consent-manager-provider.md +0 -425
  157. package/docs/hooks/use-consent-manager/overview.md +0 -420
  158. package/docs/hooks/use-translations.md +0 -118
  159. package/docs/styling/css-variables.md +0 -92
  160. package/docs/styling/overview.md +0 -457
  161. package/docs/styling/slots.md +0 -128
  162. package/docs/styling/tokens.md +0 -216
@@ -0,0 +1,299 @@
1
+ ---
2
+ title: Styling Overview
3
+ description: Five approaches for theming consent components — design tokens,
4
+ component slots, CSS variables, className, and noStyle mode.
5
+ group: frameworks
6
+ ---
7
+ c15t's theming system gives you multiple levels of control, but most customization should stay inside the pre-built components.
8
+
9
+ Start with the lowest-power tool that solves the problem:
10
+
11
+ 1. **Pre-built component APIs** — provider options and component props such as `layout`, `direction`, `primaryButton`, `legalLinks`, and `theme.consentActions`
12
+ 2. **Design tokens** — global colors, typography, spacing, radius, shadows, and motion
13
+ 3. **Slots** — targeted styling for specific parts such as the banner card, footer, or title
14
+ 4. **CSS variables or className-level overrides** — when you need to integrate with external CSS systems
15
+ 5. **Compound components** — when you must rearrange markup while still using c15t primitives
16
+ 6. **`noStyle`** — when you want c15t structure but you need to own all visual styling
17
+ 7. **Headless** — when you want fully custom markup and behavior
18
+
19
+ Keep styling and escalation as separate decisions:
20
+
21
+ * If you are still using the stock banner, dialog, or widget, stay with props, tokens, and slots.
22
+ * Escalate to compound components, `noStyle`, or headless only when the structure or behavior itself must change.
23
+
24
+ ## Styling Approaches
25
+
26
+ |Approach|Control|Use When|
27
+ |--|--|--|
28
+ |**Component and provider APIs**|High|Reordering actions, changing button emphasis, configuring links, hiding branding, changing copy via `i18n`|
29
+ |**Tokens**|High|Changing global colors, typography, spacing, radius, shadows, or motion|
30
+ |**Slots**|Medium|Targeting specific component parts (for example `consentBannerFooter` or `consentDialogCard`)|
31
+ |**CSS variables / className**|Medium|Integrating with an existing stylesheet or utility classes after tokens and slots|
32
+ |**Compound components**|Structure|Rearranging existing c15t primitives without going fully custom|
33
+ |**noStyle**|Full visuals|Keeping c15t structure but replacing all visual defaults|
34
+ |**Headless**|Full|Replacing both markup and behavior|
35
+
36
+ ## Quick Start
37
+
38
+ ```tsx
39
+ import { type Theme, ConsentManagerProvider, ConsentBanner, ConsentDialog } from '@c15t/nextjs';
40
+
41
+ const theme = {
42
+ colors: {
43
+ primary: '#6366f1',
44
+ primaryHover: '#4f46e5',
45
+ },
46
+ radius: {
47
+ md: '0.75rem',
48
+ lg: '1rem',
49
+ },
50
+ slots: {
51
+ consentBannerTitle: 'text-xl font-semibold',
52
+ buttonPrimary: 'rounded-full',
53
+ },
54
+ } satisfies Theme;
55
+
56
+ export function ConsentManager({ children }) {
57
+ return (
58
+ <ConsentManagerProvider
59
+ options={{
60
+ mode: 'hosted',
61
+ backendURL: '/api/c15t',
62
+ theme,
63
+ }}
64
+ >
65
+ <ConsentBanner />
66
+ <ConsentDialog />
67
+ {children}
68
+ </ConsentManagerProvider>
69
+ );
70
+ }
71
+ ```
72
+
73
+ ## Styling Inside Pre-Built Components
74
+
75
+ Start here before you consider compound components or headless mode.
76
+
77
+ ### 1. Provider and component configuration
78
+
79
+ Use the stock APIs first:
80
+
81
+ * `layout`, `direction`, and `primaryButton` for banner action arrangement
82
+ * `legalLinks` for link visibility
83
+ * `hideBranding` and `showTrigger` for dialog and widget behavior
84
+ * `theme.consentActions` for stock banner and dialog button treatment
85
+ * `i18n` on `ConsentManagerProvider` for copy changes
86
+
87
+ ```tsx
88
+ <ConsentBanner layout={['customize', ['reject', 'accept']]} primaryButton="accept" />
89
+ ```
90
+
91
+ ### 2. Design tokens
92
+
93
+ Set global values for colors, typography, spacing, radius, shadows, and motion:
94
+
95
+ ```tsx
96
+ options={{ theme: { colors: { primary: '#6366f1' } } }}
97
+ ```
98
+
99
+ Use tokens first when the change is semantic:
100
+
101
+ * Banner card background -> `theme.colors.surface`
102
+ * Banner footer background -> `theme.colors.surfaceHover`
103
+ * Shared copy color -> `theme.colors.text` and `theme.colors.textMuted`
104
+ * Primary-filled surfaces such as stock branding tags and filled actions -> `theme.colors.primary` with `theme.colors.textOnPrimary` as the matching foreground override
105
+
106
+ ```tsx
107
+ options={{
108
+ theme: {
109
+ colors: {
110
+ surface: '#ffffff',
111
+ surfaceHover: '#f6f3ee',
112
+ },
113
+ },
114
+ }}
115
+ ```
116
+
117
+ If you set `theme.colors.primary` but omit `theme.colors.textOnPrimary`, c15t derives a readable foreground automatically. Add `textOnPrimary` only when you need to force a specific branded foreground color.
118
+
119
+ ### 3. Component slots
120
+
121
+ Target specific component parts via the `slots` object:
122
+
123
+ ```tsx
124
+ options={{
125
+ theme: {
126
+ slots: {
127
+ consentBannerCard: 'rounded-[28px] shadow-xl',
128
+ consentBannerFooter: 'border-t border-black/10',
129
+ consentBannerTitle: 'tracking-tight',
130
+ },
131
+ },
132
+ }}
133
+ ```
134
+
135
+ Use slots when the component part is right but the local styling needs adjustment.
136
+
137
+ ### 4. CSS variables and className-level overrides
138
+
139
+ Override `--c15t-*` custom properties in your stylesheet or attach classes through slots when your app styling is driven externally.
140
+
141
+ Reach for this after tokens and slots, not before.
142
+
143
+ ```tsx
144
+ options={{
145
+ theme: {
146
+ slots: {
147
+ consentBannerFooter: 'bg-[var(--banner-footer)]',
148
+ },
149
+ },
150
+ }}
151
+ ```
152
+
153
+ ## Escalating Beyond Pre-Built Components
154
+
155
+ Only move up this ladder when the lower rung cannot satisfy the request.
156
+
157
+ ### 5. Compound components
158
+
159
+ Use compound components when you need to rearrange existing c15t primitives:
160
+
161
+ ```tsx
162
+ <ConsentBanner.Root>
163
+ <ConsentBanner.Card>
164
+ <ConsentBanner.Header>
165
+ <ConsentBanner.Title />
166
+ <ConsentBanner.Description />
167
+ </ConsentBanner.Header>
168
+ <ConsentBanner.Footer>
169
+ <ConsentBanner.CustomizeButton />
170
+ <ConsentBanner.FooterSubGroup>
171
+ <ConsentBanner.RejectButton />
172
+ <ConsentBanner.AcceptButton />
173
+ </ConsentBanner.FooterSubGroup>
174
+ </ConsentBanner.Footer>
175
+ </ConsentBanner.Card>
176
+ </ConsentBanner.Root>
177
+ ```
178
+
179
+ ### 6. `noStyle`
180
+
181
+ Use `noStyle` only when the c15t structure is still correct but you want to replace all visual defaults:
182
+
183
+ ```tsx
184
+ <ConsentBanner noStyle />
185
+ ```
186
+
187
+ ### 7. Headless
188
+
189
+ Go headless only when you are replacing both markup and behavior. For that path, continue to [Headless Mode](../headless).
190
+
191
+ ## Common Styling Tasks
192
+
193
+ ### Change the banner footer background
194
+
195
+ ```tsx
196
+ options={{
197
+ theme: {
198
+ colors: {
199
+ surfaceHover: '#f6f3ee',
200
+ },
201
+ },
202
+ }}
203
+ ```
204
+
205
+ Use `theme.colors.surfaceHover` before trying raw CSS.
206
+
207
+ ### Change the banner card background
208
+
209
+ ```tsx
210
+ options={{
211
+ theme: {
212
+ colors: {
213
+ surface: '#fffdf8',
214
+ },
215
+ },
216
+ }}
217
+ ```
218
+
219
+ Use `theme.colors.surface` before overriding banner CSS variables directly.
220
+
221
+ ### Tweak the banner card, footer, or title styling without changing markup
222
+
223
+ ```tsx
224
+ options={{
225
+ theme: {
226
+ slots: {
227
+ consentBannerCard: 'rounded-[28px] shadow-xl',
228
+ consentBannerFooter: 'border-t border-black/10 px-6',
229
+ consentBannerTitle: 'text-xl tracking-tight',
230
+ },
231
+ },
232
+ }}
233
+ ```
234
+
235
+ ### Change stock consent action button styles semantically
236
+
237
+ ```tsx
238
+ options={{
239
+ theme: {
240
+ consentActions: {
241
+ default: { mode: 'stroke' },
242
+ accept: { variant: 'primary', mode: 'stroke' },
243
+ customize: { variant: 'neutral', mode: 'ghost' },
244
+ },
245
+ },
246
+ }}
247
+ ```
248
+
249
+ Use `theme.consentActions` when you want to change the stock banner/dialog button treatment without rewriting the component layout. Policy packs still control action arrangement and primary-action hints. The theme controls whether those actions render as `stroke`, `filled`, `ghost`, or `lighter`.
250
+
251
+ ### Change banner copy without replacing the component
252
+
253
+ ```tsx
254
+ options={{
255
+ i18n: {
256
+ locale: 'en',
257
+ messages: {
258
+ en: {
259
+ cookieBanner: {
260
+ title: 'We value your privacy',
261
+ description: 'We use cookies to improve the site and measure performance.',
262
+ },
263
+ common: {
264
+ acceptAll: 'Accept all',
265
+ rejectAll: 'Reject all',
266
+ customize: 'Manage preferences',
267
+ },
268
+ },
269
+ },
270
+ },
271
+ }}
272
+ ```
273
+
274
+ ### Enable dark mode safely
275
+
276
+ ```tsx
277
+ options={{
278
+ colorScheme: 'system',
279
+ theme: {
280
+ colors: { surface: '#ffffff', text: '#1f2937' },
281
+ dark: { surface: '#111827', text: '#f9fafb' },
282
+ },
283
+ }}
284
+ ```
285
+
286
+ > ℹ️ **Info:**
287
+ > If a token change does not show up where you expect, check how that component maps tokens to CSS variables before escalating. For example, the stock banner footer background comes from colors.surfaceHover, not a separate footer token.
288
+ >
289
+ > ⚠️ **Warning:**
290
+ > Do not jump to CSS overrides or !important because a token did not appear to work at first glance.noStyle: true removes layout and visual defaults. Treat it as an advanced opt-out, not a normal theming step.Headless mode is for replacing markup and behavior, not for styling-only requests.Use either tokens/slots or raw CSS variable overrides intentionally to avoid conflicting style sources.For dark mode, c15t supports .dark and .c15t-dark.
291
+
292
+ ## API Reference
293
+
294
+ |Property|Value|
295
+ |:--|:--|
296
+ |Type Name|\`Theme\`|
297
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
298
+
299
+ \*ExtractedTypeTable: Could not extract "Theme" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -0,0 +1,94 @@
1
+ ---
2
+ title: Component Slots
3
+ description: Target individual component parts with styles using the slot system
4
+ - className strings or inline style objects.
5
+ group: frameworks
6
+ ---
7
+ ## What are Slots?
8
+
9
+ Slots let you target specific parts of consent components with styles. Each component is built from named slots such as `consentBannerTitle` and `consentDialogTag`.
10
+
11
+ Use slots after the stock component APIs and design tokens:
12
+
13
+ * If the change is semantic, prefer tokens first. For example, the stock banner footer background comes from `theme.colors.surfaceHover`.
14
+ * If the component part is correct but you need a local tweak, use a slot.
15
+
16
+ Common banner slot choices:
17
+
18
+ * `consentBannerCard` for card radius, shadow, width, and local background treatment
19
+ * `consentBannerFooter` for spacing, borders, and local footer styling
20
+ * `consentBannerTitle` for title typography
21
+ * `buttonPrimary` and `buttonSecondary` for shared button classes
22
+
23
+ ## Using Slots
24
+
25
+ Pass slot styles in the theme's `slots` object:
26
+
27
+ ```tsx
28
+ const theme = {
29
+ slots: {
30
+ consentBannerFooter: 'border-t border-black/10 px-6',
31
+ consentBannerTitle: 'text-xl font-bold tracking-tight',
32
+
33
+ // Object value = className + inline styles
34
+ consentBannerCard: {
35
+ className: 'rounded-xl shadow-lg',
36
+ style: { maxWidth: '600px' },
37
+ },
38
+ },
39
+ } satisfies Theme;
40
+ ```
41
+
42
+ ## Slot Style Types
43
+
44
+ Each slot accepts either a `string` (treated as className) or a `SlotStyle` object:
45
+
46
+ ```tsx
47
+ // String: treated as className
48
+ consentBannerTitle: 'my-custom-class'
49
+
50
+ // Object: className + style + noStyle
51
+ consentBannerFooter: {
52
+ className: 'border-t border-black/10',
53
+ style: { paddingBlock: '1rem' },
54
+ noStyle: false, // Set true only when you want to remove this slot's default styling
55
+ }
56
+ ```
57
+
58
+ `noStyle` on a slot is an advanced escape hatch. Start with className and style overrides first.
59
+
60
+ ## Example: Style the stock banner without changing markup
61
+
62
+ ```tsx
63
+ const theme = {
64
+ colors: {
65
+ surface: '#fffdf8',
66
+ surfaceHover: '#f6f3ee',
67
+ },
68
+ slots: {
69
+ consentBannerCard: 'rounded-[28px] shadow-xl',
70
+ consentBannerFooter: 'border-t border-black/10 px-6',
71
+ consentBannerTitle: 'tracking-tight',
72
+ },
73
+ } satisfies Theme;
74
+ ```
75
+
76
+ ## Available Slots
77
+
78
+ Use the typed API reference below for the full slot list and descriptions. It stays in sync with the actual component slot surface.
79
+
80
+ ## API Reference
81
+
82
+ |Property|Value|
83
+ |:--|:--|
84
+ |Type Name|\`ComponentSlots\`|
85
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
86
+
87
+ \*ExtractedTypeTable: Could not extract "ComponentSlots" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
88
+
89
+ |Property|Value|
90
+ |:--|:--|
91
+ |Type Name|\`SlotStyle\`|
92
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
93
+
94
+ \*ExtractedTypeTable: Could not extract "SlotStyle" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Tailwind CSS
3
- description: Use Tailwind CSS utility classes to style consent components via the slot system.
3
+ description: Use Tailwind CSS utility classes to style consent components via
4
+ the slot system.
5
+ group: frameworks
4
6
  ---
5
7
  c15t works with Tailwind CSS out of the box. Use the `slots` theme option to apply Tailwind utility classes to any component part.
6
8
 
@@ -0,0 +1,156 @@
1
+ ---
2
+ title: Design Tokens
3
+ description: The six base token categories that control colors, typography,
4
+ spacing, radius, shadows, and motion, plus optional dark-mode overrides.
5
+ group: frameworks
6
+ ---
7
+ ## Color Tokens
8
+
9
+ Color tokens define the palette for all consent components. Set `colors` for light mode and `dark` for dark mode overrides.
10
+
11
+ When `textOnPrimary` is omitted, c15t derives it automatically from `primary` to keep text readable on primary-filled surfaces such as stock branding tags and buttons. Set `textOnPrimary` explicitly when you need a specific foreground color.
12
+
13
+ ```tsx
14
+ const theme = {
15
+ colors: {
16
+ primary: '#6366f1',
17
+ primaryHover: '#4f46e5',
18
+ surface: '#ffffff',
19
+ surfaceHover: '#f9fafb',
20
+ border: '#e5e7eb',
21
+ borderHover: '#d1d5db',
22
+ text: '#1f2937',
23
+ textMuted: '#6b7280',
24
+ textOnPrimary: '#ffffff',
25
+ overlay: 'rgba(0, 0, 0, 0.5)',
26
+ switchTrack: '#d1d5db',
27
+ switchTrackActive: '#6366f1',
28
+ switchThumb: '#ffffff',
29
+ },
30
+ dark: {
31
+ primary: '#818cf8',
32
+ surface: '#1f2937',
33
+ text: '#f9fafb',
34
+ textMuted: '#9ca3af',
35
+ border: '#374151',
36
+ },
37
+ } satisfies Theme;
38
+ ```
39
+
40
+ |Property|Value|
41
+ |:--|:--|
42
+ |Type Name|\`ColorTokens\`|
43
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
44
+
45
+ \*ExtractedTypeTable: Could not extract "ColorTokens" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
46
+
47
+ ## Typography Tokens
48
+
49
+ Control font family, sizes, weights, and line heights.
50
+
51
+ ```tsx
52
+ const theme = {
53
+ typography: {
54
+ fontFamily: 'Inter, system-ui, sans-serif',
55
+ fontSize: { sm: '0.875rem', base: '1rem', lg: '1.125rem' },
56
+ fontWeight: { normal: 400, medium: 500, semibold: 600 },
57
+ lineHeight: { tight: '1.25', normal: '1.5', relaxed: '1.75' },
58
+ },
59
+ } satisfies Theme;
60
+ ```
61
+
62
+ |Property|Value|
63
+ |:--|:--|
64
+ |Type Name|\`TypographyTokens\`|
65
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
66
+
67
+ \*ExtractedTypeTable: Could not extract "TypographyTokens" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
68
+
69
+ ## Spacing Tokens
70
+
71
+ Five-step scale for internal padding, margins, and gaps.
72
+
73
+ ```tsx
74
+ const theme = {
75
+ spacing: {
76
+ xs: '0.25rem', // 4px
77
+ sm: '0.5rem', // 8px
78
+ md: '1rem', // 16px
79
+ lg: '1.5rem', // 24px
80
+ xl: '2rem', // 32px
81
+ },
82
+ } satisfies Theme;
83
+ ```
84
+
85
+ |Property|Value|
86
+ |:--|:--|
87
+ |Type Name|\`SpacingTokens\`|
88
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
89
+
90
+ \*ExtractedTypeTable: Could not extract "SpacingTokens" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
91
+
92
+ ## Radius Tokens
93
+
94
+ Border radius scale for rounded corners.
95
+
96
+ ```tsx
97
+ const theme = {
98
+ radius: {
99
+ sm: '0.25rem', // 4px
100
+ md: '0.5rem', // 8px
101
+ lg: '0.75rem', // 12px
102
+ full: '9999px', // Pill shape
103
+ },
104
+ } satisfies Theme;
105
+ ```
106
+
107
+ |Property|Value|
108
+ |:--|:--|
109
+ |Type Name|\`RadiusTokens\`|
110
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
111
+
112
+ \*ExtractedTypeTable: Could not extract "RadiusTokens" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
113
+
114
+ ## Shadow Tokens
115
+
116
+ Box shadow scale for depth and elevation.
117
+
118
+ ```tsx
119
+ const theme = {
120
+ shadows: {
121
+ sm: '0 1px 2px hsla(0, 0%, 0%, 0.05)',
122
+ md: '0 4px 12px hsla(0, 0%, 0%, 0.08)',
123
+ lg: '0 8px 24px hsla(0, 0%, 0%, 0.12)',
124
+ },
125
+ } satisfies Theme;
126
+ ```
127
+
128
+ |Property|Value|
129
+ |:--|:--|
130
+ |Type Name|\`ShadowTokens\`|
131
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
132
+
133
+ \*ExtractedTypeTable: Could not extract "ShadowTokens" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
134
+
135
+ ## Motion Tokens
136
+
137
+ Animation duration and easing presets.
138
+
139
+ ```tsx
140
+ const theme = {
141
+ motion: {
142
+ duration: { fast: '100ms', normal: '200ms', slow: '300ms' },
143
+ easing: 'cubic-bezier(0.4, 0, 0.2, 1)',
144
+ easingOut: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
145
+ easingInOut: 'cubic-bezier(0.645, 0.045, 0.355, 1)',
146
+ easingSpring: 'cubic-bezier(0.34, 1.56, 0.64, 1)',
147
+ },
148
+ } satisfies Theme;
149
+ ```
150
+
151
+ |Property|Value|
152
+ |:--|:--|
153
+ |Type Name|\`MotionTokens\`|
154
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
155
+
156
+ \*ExtractedTypeTable: Could not extract "MotionTokens" from "./packages/ui/src/theme/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Troubleshooting
3
- description: Solutions for common issues with @c15t/nextjs — provider errors, missing banners, consent persistence, and more.
3
+ description: Solutions for common issues with @c15t/nextjs — provider errors,
4
+ missing banners, consent persistence, and more.
5
+ group: frameworks
4
6
  ---
5
7
  ## "Provider not found" Error
6
8