@c15t/react 2.1.0 → 2.2.0-canary-20260731105620

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 (332) hide show
  1. package/AGENTS.md +155 -0
  2. package/README.md +29 -14
  3. package/client/components/integrations.js +3 -0
  4. package/dist/components/consent-banner/atoms/overlay.cjs +1 -1
  5. package/dist/components/consent-banner/atoms/root.cjs +1 -1
  6. package/dist/components/consent-banner/components.cjs +1 -1
  7. package/dist/components/consent-banner/consent-banner.cjs +1 -1
  8. package/dist/components/consent-banner/error-boundary.cjs +1 -1
  9. package/dist/components/consent-banner/index.cjs +1 -1
  10. package/dist/components/consent-banner/policy-actions.cjs +1 -1
  11. package/dist/components/consent-dialog/atoms/card.cjs +1 -1
  12. package/dist/components/consent-dialog/atoms/overlay.cjs +1 -1
  13. package/dist/components/consent-dialog/atoms/root.cjs +1 -1
  14. package/dist/components/consent-dialog/consent-dialog.cjs +1 -1
  15. package/dist/components/consent-dialog/index.cjs +1 -1
  16. package/dist/components/consent-dialog-link/index.cjs +1 -1
  17. package/dist/components/consent-dialog-trigger/atoms/button.cjs +1 -1
  18. package/dist/components/consent-dialog-trigger/atoms/button.js +1 -1
  19. package/dist/components/consent-dialog-trigger/atoms/icon.cjs +1 -1
  20. package/dist/components/consent-dialog-trigger/atoms/root.cjs +1 -1
  21. package/dist/components/consent-dialog-trigger/atoms/text.cjs +1 -1
  22. package/dist/components/consent-dialog-trigger/atoms/toolbar.cjs +1 -0
  23. package/dist/components/consent-dialog-trigger/atoms/toolbar.js +1 -0
  24. package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.cjs +1 -0
  25. package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.js +1 -0
  26. package/dist/components/consent-dialog-trigger/consent-dialog-trigger.cjs +1 -1
  27. package/dist/components/consent-dialog-trigger/index.cjs +1 -1
  28. package/dist/components/consent-dialog-trigger/index.js +1 -1
  29. package/dist/components/consent-dialog-trigger/use-draggable.cjs +1 -1
  30. package/dist/components/consent-preferences-link/consent-preferences-link.cjs +1 -1
  31. package/dist/components/consent-preferences-link/index.cjs +1 -1
  32. package/dist/components/consent-widget/atoms/accordion.cjs +1 -1
  33. package/dist/components/consent-widget/atoms/button.cjs +1 -1
  34. package/dist/components/consent-widget/atoms/footer.cjs +1 -1
  35. package/dist/components/consent-widget/atoms/root.cjs +1 -1
  36. package/dist/components/consent-widget/consent-widget.cjs +1 -1
  37. package/dist/components/consent-widget/index.cjs +1 -1
  38. package/dist/components/consent-widget/policy-actions.cjs +1 -1
  39. package/dist/components/frame/atoms.cjs +1 -1
  40. package/dist/components/frame/atoms.js +1 -1
  41. package/dist/components/frame/frame.cjs +1 -1
  42. package/dist/components/frame/index.cjs +1 -1
  43. package/dist/components/iab-consent-banner/atoms/button-group.cjs +1 -1
  44. package/dist/components/iab-consent-banner/atoms/card.cjs +1 -1
  45. package/dist/components/iab-consent-banner/atoms/description.cjs +1 -1
  46. package/dist/components/iab-consent-banner/atoms/footer.cjs +1 -1
  47. package/dist/components/iab-consent-banner/atoms/header.cjs +1 -1
  48. package/dist/components/iab-consent-banner/atoms/overlay.cjs +1 -1
  49. package/dist/components/iab-consent-banner/atoms/root.cjs +1 -1
  50. package/dist/components/iab-consent-banner/atoms/title.cjs +1 -1
  51. package/dist/components/iab-consent-banner/iab-consent-banner.cjs +1 -1
  52. package/dist/components/iab-consent-banner/iab-consent-banner.js +1 -1
  53. package/dist/components/iab-consent-banner/index.cjs +1 -1
  54. package/dist/components/iab-consent-dialog/atoms/card.cjs +1 -1
  55. package/dist/components/iab-consent-dialog/atoms/content.cjs +1 -1
  56. package/dist/components/iab-consent-dialog/atoms/footer.cjs +1 -1
  57. package/dist/components/iab-consent-dialog/atoms/header.cjs +1 -1
  58. package/dist/components/iab-consent-dialog/atoms/overlay.cjs +1 -1
  59. package/dist/components/iab-consent-dialog/atoms/purpose-item.cjs +1 -1
  60. package/dist/components/iab-consent-dialog/atoms/root.cjs +1 -1
  61. package/dist/components/iab-consent-dialog/atoms/stack-item.cjs +1 -1
  62. package/dist/components/iab-consent-dialog/atoms/tabs.cjs +1 -1
  63. package/dist/components/iab-consent-dialog/atoms/vendor-list.cjs +1 -1
  64. package/dist/components/iab-consent-dialog/hooks/use-gvl-data.cjs +1 -1
  65. package/dist/components/iab-consent-dialog/iab-consent-dialog.cjs +1 -1
  66. package/dist/components/iab-consent-dialog/index.cjs +1 -1
  67. package/dist/components/iab-consent-dialog/use-iab-translations.cjs +1 -1
  68. package/dist/components/integrations/google-map.cjs +1 -0
  69. package/dist/components/integrations/google-map.js +1 -0
  70. package/dist/components/integrations/index.cjs +1 -0
  71. package/dist/components/integrations/index.js +1 -0
  72. package/dist/components/integrations/shared.cjs +1 -0
  73. package/dist/components/integrations/shared.js +1 -0
  74. package/dist/components/integrations/youtube-embed.cjs +1 -0
  75. package/dist/components/integrations/youtube-embed.js +1 -0
  76. package/dist/components/shared/libs/recursive-clone-children.cjs +1 -1
  77. package/dist/components/shared/libs/slot.cjs +1 -1
  78. package/dist/components/shared/libs/use-controllable-state.cjs +1 -1
  79. package/dist/components/shared/policy-actions.cjs +1 -1
  80. package/dist/components/shared/primitives/box.cjs +1 -1
  81. package/dist/components/shared/primitives/button.cjs +1 -1
  82. package/dist/components/shared/primitives/button.js +1 -1
  83. package/dist/components/shared/primitives/legal-links/index.cjs +1 -1
  84. package/dist/components/shared/primitives/legal-links/index.js +1 -1
  85. package/dist/components/shared/ui/accordion/accordion.cjs +1 -1
  86. package/dist/components/shared/ui/accordion/index.cjs +1 -1
  87. package/dist/components/shared/ui/animated-collapse/animated-collapse.cjs +1 -1
  88. package/dist/components/shared/ui/animated-collapse/index.cjs +1 -1
  89. package/dist/components/shared/ui/branding.cjs +1 -1
  90. package/dist/components/shared/ui/button/button.cjs +1 -1
  91. package/dist/components/shared/ui/button/index.cjs +1 -1
  92. package/dist/components/shared/ui/collapsible/collapsible.cjs +1 -1
  93. package/dist/components/shared/ui/collapsible/index.cjs +1 -1
  94. package/dist/components/shared/ui/dialog/dialog.cjs +1 -1
  95. package/dist/components/shared/ui/dialog/index.cjs +1 -1
  96. package/dist/components/shared/ui/icon.cjs +1 -1
  97. package/dist/components/shared/ui/logo.cjs +1 -1
  98. package/dist/components/shared/ui/preference-item/index.cjs +1 -1
  99. package/dist/components/shared/ui/preference-item/preference-item.cjs +1 -1
  100. package/dist/components/shared/ui/switch/index.cjs +1 -1
  101. package/dist/components/shared/ui/switch/switch.cjs +1 -1
  102. package/dist/components/shared/ui/tabs/index.cjs +1 -1
  103. package/dist/components/shared/ui/tabs/tabs.cjs +1 -1
  104. package/dist/context/consent-manager-context.cjs +1 -1
  105. package/dist/context/consent-tracking-context.cjs +1 -1
  106. package/dist/context/theme-context.cjs +1 -1
  107. package/dist/headless.cjs +1 -1
  108. package/dist/headless.js +1 -1
  109. package/dist/hooks/index.cjs +1 -1
  110. package/dist/hooks/index.js +1 -1
  111. package/dist/hooks/use-color-scheme.cjs +1 -1
  112. package/dist/hooks/use-component-config.cjs +1 -1
  113. package/dist/hooks/use-consent-dialog-trigger.cjs +1 -1
  114. package/dist/hooks/use-consent-manager.cjs +1 -1
  115. package/dist/hooks/use-consent-script.cjs +1 -0
  116. package/dist/hooks/use-consent-script.js +1 -0
  117. package/dist/hooks/use-focus-trap.cjs +1 -1
  118. package/dist/hooks/use-headless-consent-ui.cjs +1 -1
  119. package/dist/hooks/use-headless-iab-consent-ui.cjs +1 -1
  120. package/dist/hooks/use-reduced-motion.cjs +1 -1
  121. package/dist/hooks/use-scroll-lock.cjs +1 -1
  122. package/dist/hooks/use-ssr-status.cjs +1 -1
  123. package/dist/hooks/use-styles.cjs +1 -1
  124. package/dist/hooks/use-text-direction.cjs +1 -1
  125. package/dist/hooks/use-theme.cjs +1 -1
  126. package/dist/hooks/use-translations.cjs +1 -1
  127. package/dist/iab.cjs +1 -1
  128. package/dist/index.cjs +1 -1
  129. package/dist/index.js +1 -1
  130. package/dist/primitives/accordion.cjs +1 -1
  131. package/dist/primitives/button.cjs +1 -1
  132. package/dist/primitives/collapsible.cjs +1 -1
  133. package/dist/primitives/dialog.cjs +1 -1
  134. package/dist/primitives/preference-item.cjs +1 -1
  135. package/dist/primitives/switch.cjs +1 -1
  136. package/dist/primitives/tabs.cjs +1 -1
  137. package/dist/primitives.cjs +1 -1
  138. package/dist/providers/consent-manager-provider.cjs +1 -1
  139. package/dist/providers/consent-manager-provider.js +1 -1
  140. package/dist/server/fetch-ssr-data.cjs +1 -1
  141. package/dist/server/fetch-ssr-data.js +1 -1
  142. package/dist/server/headers.cjs +1 -1
  143. package/dist/server/headers.js +1 -1
  144. package/dist/server/index.cjs +1 -1
  145. package/dist/server/init-cache-key.cjs +1 -1
  146. package/dist/server/normalize-url.cjs +1 -1
  147. package/dist/styles.tw3.css +1 -1
  148. package/dist/types/theme/index.cjs +1 -1
  149. package/dist/types/theme/style-types.cjs +1 -1
  150. package/dist/utils/cn.cjs +1 -1
  151. package/dist/utils/merge-styles.cjs +1 -1
  152. package/dist/utils/test-helpers.cjs +1 -1
  153. package/dist/utils/theme-utils.cjs +1 -1
  154. package/dist/version.cjs +1 -1
  155. package/dist/version.js +1 -1
  156. package/dist-types/components/consent-banner/components.d.ts +2 -2
  157. package/dist-types/components/consent-banner/policy-actions.d.ts +1 -1
  158. package/dist-types/components/consent-dialog/atoms/card.d.ts +5 -5
  159. package/dist-types/components/consent-dialog-trigger/atoms/toolbar.d.ts +22 -0
  160. package/dist-types/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.d.ts +35 -0
  161. package/dist-types/components/consent-dialog-trigger/index.d.ts +2 -1
  162. package/dist-types/components/consent-dialog-trigger/types.d.ts +111 -6
  163. package/dist-types/components/consent-widget/atoms/accordion.d.ts +4 -4
  164. package/dist-types/components/consent-widget/consent-widget.d.ts +1 -1
  165. package/dist-types/components/consent-widget/policy-actions.d.ts +1 -1
  166. package/dist-types/components/integrations/google-map.d.ts +82 -0
  167. package/dist-types/components/integrations/index.d.ts +2 -0
  168. package/dist-types/components/integrations/shared.d.ts +12 -0
  169. package/dist-types/components/integrations/youtube-embed.d.ts +95 -0
  170. package/dist-types/components/shared/policy-actions.d.ts +1 -1
  171. package/dist-types/components/shared/primitives/button.d.ts +36 -2
  172. package/dist-types/components/shared/primitives/legal-links/index.d.ts +1 -1
  173. package/dist-types/components/shared/ui/accordion/accordion.d.ts +2 -2
  174. package/dist-types/components/shared/ui/branding.d.ts +3 -3
  175. package/dist-types/components/shared/ui/button/button.d.ts +1 -1
  176. package/dist-types/components/shared/ui/dialog/dialog.d.ts +1 -1
  177. package/dist-types/components/shared/ui/logo.d.ts +8 -8
  178. package/dist-types/headless.d.ts +1 -0
  179. package/dist-types/hooks/index.d.ts +1 -0
  180. package/dist-types/hooks/use-consent-script.d.ts +80 -0
  181. package/dist-types/index.d.ts +3 -1
  182. package/dist-types/providers/consent-manager-provider.d.ts +1 -1
  183. package/dist-types/server/headers.d.ts +1 -1
  184. package/dist-types/utils/theme-utils.d.ts +1 -1
  185. package/dist-types/version.d.ts +1 -1
  186. package/docs/README.md +155 -76
  187. package/docs/{building-headless-components.md → frameworks/react/building-headless-components.md} +3 -1
  188. package/docs/{callbacks.md → frameworks/react/callbacks.md} +3 -1
  189. package/docs/{components → frameworks/react/components}/consent-banner.md +10 -21
  190. package/docs/{components → frameworks/react/components}/consent-dialog-link.md +8 -5
  191. package/docs/frameworks/react/components/consent-dialog-trigger.md +202 -0
  192. package/docs/{components → frameworks/react/components}/consent-dialog.md +7 -15
  193. package/docs/frameworks/react/components/consent-manager-provider.md +270 -0
  194. package/docs/{components → frameworks/react/components}/consent-widget.md +8 -6
  195. package/docs/{components → frameworks/react/components}/dev-tools.md +9 -6
  196. package/docs/{components → frameworks/react/components}/frame.md +8 -9
  197. package/docs/{concepts → frameworks/react/concepts}/client-modes.md +4 -2
  198. package/docs/{concepts → frameworks/react/concepts}/consent-categories.md +1 -0
  199. package/docs/{concepts → frameworks/react/concepts}/consent-models.md +1 -0
  200. package/docs/{concepts → frameworks/react/concepts}/cookie-management.md +3 -3
  201. package/docs/{concepts → frameworks/react/concepts}/glossary.md +1 -0
  202. package/docs/{concepts → frameworks/react/concepts}/initialization-flow.md +1 -0
  203. package/docs/{concepts → frameworks/react/concepts}/policy-packs.md +1 -0
  204. package/docs/{headless.md → frameworks/react/headless.md} +3 -1
  205. package/docs/{hooks → frameworks/react/hooks}/use-color-scheme.md +1 -0
  206. package/docs/{hooks → frameworks/react/hooks}/use-consent-manager/checking-consent.md +3 -1
  207. package/docs/{hooks → frameworks/react/hooks}/use-consent-manager/location-info.md +3 -1
  208. package/docs/frameworks/react/hooks/use-consent-manager/overview.md +172 -0
  209. package/docs/{hooks → frameworks/react/hooks}/use-consent-manager/setting-consent.md +3 -1
  210. package/docs/{hooks → frameworks/react/hooks}/use-draggable.md +3 -1
  211. package/docs/{hooks → frameworks/react/hooks}/use-focus-trap.md +1 -0
  212. package/docs/{hooks → frameworks/react/hooks}/use-reduced-motion.md +3 -1
  213. package/docs/{hooks → frameworks/react/hooks}/use-ssr-status.md +6 -5
  214. package/docs/{hooks → frameworks/react/hooks}/use-text-direction.md +1 -0
  215. package/docs/frameworks/react/hooks/use-translations.md +55 -0
  216. package/docs/{iab → frameworks/react/iab}/consent-banner.md +9 -12
  217. package/docs/{iab → frameworks/react/iab}/consent-dialog.md +9 -14
  218. package/docs/{iab → frameworks/react/iab}/overview.md +4 -2
  219. package/docs/{iab → frameworks/react/iab}/use-gvl-data.md +3 -2
  220. package/docs/{iframe-blocking.md → frameworks/react/iframe-blocking.md} +8 -9
  221. package/docs/{internationalization.md → frameworks/react/internationalization.md} +13 -3
  222. package/docs/{network-blocker.md → frameworks/react/network-blocker.md} +13 -51
  223. package/docs/{optimization.md → frameworks/react/optimization.md} +3 -2
  224. package/docs/{policy-packs.md → frameworks/react/policy-packs.md} +3 -1
  225. package/docs/{quickstart.md → frameworks/react/quickstart.md} +26 -42
  226. package/docs/{script-loader.md → frameworks/react/script-loader.md} +136 -89
  227. package/docs/{server-side.md → frameworks/react/server-side.md} +9 -4
  228. package/docs/{styling → frameworks/react/styling}/classnames.md +3 -1
  229. package/docs/{styling → frameworks/react/styling}/color-scheme.md +3 -1
  230. package/docs/frameworks/react/styling/css-variables.md +53 -0
  231. package/docs/frameworks/react/styling/overview.md +302 -0
  232. package/docs/frameworks/react/styling/slots.md +94 -0
  233. package/docs/{styling → frameworks/react/styling}/tailwind.md +3 -1
  234. package/docs/frameworks/react/styling/tokens.md +156 -0
  235. package/docs/{troubleshooting.md → frameworks/react/troubleshooting.md} +3 -1
  236. package/docs/integrations/adobe-analytics.md +160 -0
  237. package/docs/integrations/ahrefs-analytics.md +15 -82
  238. package/docs/integrations/amplitude.md +230 -0
  239. package/docs/integrations/building-integrations.md +15 -181
  240. package/docs/integrations/clearbit.md +130 -0
  241. package/docs/integrations/cloudflare-web-analytics.md +15 -83
  242. package/docs/integrations/crisp.md +13 -87
  243. package/docs/integrations/databuddy.md +16 -85
  244. package/docs/integrations/fathom-analytics.md +15 -86
  245. package/docs/integrations/google-maps.md +263 -0
  246. package/docs/integrations/google-tag-manager.md +18 -86
  247. package/docs/integrations/google-tag.md +15 -84
  248. package/docs/integrations/heap.md +219 -0
  249. package/docs/integrations/hightouch.md +199 -0
  250. package/docs/integrations/hotjar.md +15 -83
  251. package/docs/integrations/intercom.md +13 -83
  252. package/docs/integrations/linkedin-insights.md +15 -82
  253. package/docs/integrations/logrocket.md +175 -0
  254. package/docs/integrations/matomo-analytics.md +13 -88
  255. package/docs/integrations/meta-pixel.md +33 -316
  256. package/docs/integrations/microsoft-clarity.md +15 -83
  257. package/docs/integrations/microsoft-uet.md +16 -83
  258. package/docs/integrations/mixpanel-analytics.md +15 -83
  259. package/docs/integrations/overview.md +55 -6
  260. package/docs/integrations/pirsch.md +142 -0
  261. package/docs/integrations/plausible-analytics.md +14 -97
  262. package/docs/integrations/posthog.md +25 -97
  263. package/docs/integrations/promptwatch.md +16 -82
  264. package/docs/integrations/reddit-pixel.md +27 -122
  265. package/docs/integrations/rudderstack.md +271 -0
  266. package/docs/integrations/rybbit-analytics.md +15 -94
  267. package/docs/integrations/segment.md +15 -82
  268. package/docs/integrations/snapchat-pixel.md +21 -102
  269. package/docs/integrations/tiktok-pixel.md +13 -81
  270. package/docs/integrations/umami-analytics.md +16 -88
  271. package/docs/integrations/vercel-analytics.md +13 -85
  272. package/docs/integrations/x-pixel.md +27 -102
  273. package/docs/integrations/youtube.md +193 -0
  274. package/docs/shared/concepts/client-modes.md +103 -0
  275. package/docs/shared/concepts/consent-categories.md +41 -0
  276. package/docs/shared/concepts/consent-models.md +72 -0
  277. package/docs/shared/concepts/cookie-management.md +88 -0
  278. package/docs/shared/concepts/glossary.md +24 -0
  279. package/docs/shared/concepts/initialization-flow.md +105 -0
  280. package/docs/shared/concepts/policy-packs.md +225 -0
  281. package/docs/shared/react/components/consent-banner.md +242 -0
  282. package/docs/shared/react/components/consent-dialog-link.md +45 -0
  283. package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
  284. package/docs/shared/react/components/consent-dialog.md +119 -0
  285. package/docs/shared/react/components/consent-manager-provider.md +225 -0
  286. package/docs/shared/react/components/consent-widget.md +121 -0
  287. package/docs/shared/react/components/dev-tools.md +81 -0
  288. package/docs/shared/react/components/frame.md +52 -0
  289. package/docs/shared/react/guides/building-headless-components.md +110 -0
  290. package/docs/shared/react/guides/callbacks.md +89 -0
  291. package/docs/shared/react/guides/headless.md +31 -0
  292. package/docs/shared/react/guides/iframe-blocking.md +65 -0
  293. package/docs/shared/react/guides/internationalization.md +123 -0
  294. package/docs/shared/react/guides/network-blocker.md +72 -0
  295. package/docs/shared/react/guides/optimization.md +44 -0
  296. package/docs/shared/react/guides/policy-packs.md +173 -0
  297. package/docs/shared/react/guides/script-loader.md +311 -0
  298. package/docs/shared/react/hooks/use-color-scheme.md +31 -0
  299. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
  300. package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
  301. package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
  302. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
  303. package/docs/shared/react/hooks/use-draggable.md +30 -0
  304. package/docs/shared/react/hooks/use-focus-trap.md +20 -0
  305. package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
  306. package/docs/shared/react/hooks/use-ssr-status.md +16 -0
  307. package/docs/shared/react/hooks/use-text-direction.md +38 -0
  308. package/docs/shared/react/hooks/use-translations.md +15 -0
  309. package/docs/shared/react/iab/consent-banner.md +60 -0
  310. package/docs/shared/react/iab/consent-dialog.md +76 -0
  311. package/docs/shared/react/iab/overview.md +80 -0
  312. package/docs/shared/react/iab/use-gvl-data.md +21 -0
  313. package/docs/shared/react/styling/classnames.md +93 -0
  314. package/docs/shared/react/styling/color-scheme.md +35 -0
  315. package/docs/shared/react/styling/css-variables.md +53 -0
  316. package/docs/shared/react/styling/overview.md +261 -0
  317. package/docs/shared/react/styling/slots.md +93 -0
  318. package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
  319. package/docs/shared/react/styling/tailwind.md +88 -0
  320. package/docs/shared/react/styling/tokens.md +155 -0
  321. package/docs/shared/troubleshooting.md +82 -0
  322. package/package.json +23 -12
  323. package/readme.json +12 -7
  324. package/docs/ai-agents.md +0 -111
  325. package/docs/components/consent-dialog-trigger.md +0 -103
  326. package/docs/components/consent-manager-provider.md +0 -425
  327. package/docs/hooks/use-consent-manager/overview.md +0 -420
  328. package/docs/hooks/use-translations.md +0 -118
  329. package/docs/styling/css-variables.md +0 -92
  330. package/docs/styling/overview.md +0 -460
  331. package/docs/styling/slots.md +0 -128
  332. package/docs/styling/tokens.md +0 -216
@@ -1,38 +1,26 @@
1
1
  ---
2
2
  title: Quickstart
3
3
  description: Add consent management to your React app in under 5 minutes.
4
- lastModified: 2026-02-10
5
- availableIn:
6
- - framework: 'javascript'
7
- url: '/docs/frameworks/javascript/quickstart'
8
- title: 'JavaScript'
9
- - framework: 'react'
10
- url: '/docs/frameworks/react/quickstart'
11
- title: 'React'
12
- - framework: 'next'
13
- url: '/docs/frameworks/next/quickstart'
14
- title: 'Next.js'
4
+ variants:
5
+ - value: javascript
6
+ href: /docs/frameworks/javascript/quickstart
7
+ label: JavaScript
8
+ - value: react
9
+ href: /docs/frameworks/react/quickstart
10
+ label: React
11
+ - value: next
12
+ href: /docs/frameworks/next/quickstart
13
+ label: Next.js
14
+ group: frameworks
15
15
  ---
16
16
  ## Via CLI
17
17
 
18
- |Package manager|Command|
19
- |:--|:--|
20
- |npm|`npx @c15t/cli`|
21
- |pnpm|`pnpm dlx @c15t/cli`|
22
- |yarn|`yarn dlx @c15t/cli`|
23
- |bun|`bunx @c15t/cli`|
18
+ <PackageCommandTabs command="@c15t/cli" />
24
19
 
25
20
  ## Manual Installation
26
21
 
27
22
  1. **Install package**
28
23
 
29
- |Package manager|Command|
30
- |:--|:--|
31
- |npm|`npm install @c15t/react`|
32
- |pnpm|`pnpm add @c15t/react`|
33
- |yarn|`yarn add @c15t/react`|
34
- |bun|`bun add @c15t/react`|
35
-
36
24
  2. **Import styles** Import the prebuilt component stylesheet in your app-level CSS entrypoint. This is required for styled components to render correctly.
37
25
 
38
26
  ```css
@@ -42,7 +30,6 @@ availableIn:
42
30
  Keeping the c15t stylesheet in your global CSS entrypoint makes layer and cascade order explicit. JS/TSX side-effect imports can load in a different order across framework and Tailwind tooling, which makes style regressions harder to debug.With Tailwind v4, keep c15t at the end of the top-level @import block so Fumadocs, tw-animate-css, and other preset imports do not override c15t theme tokens.
43
31
 
44
32
  > ℹ️ Info:
45
- >
46
33
  > If you are using the headless API or fully custom styling, you can skip this import. src/main.tsx should keep importing ./index.css as usual.
47
34
 
48
35
  3. **Create ConsentManager components** Create a provider component with the consent UI and a wrapper that re-exports it. This initializes the consent store and makes consent state available to all child components.
@@ -82,14 +69,12 @@ availableIn:
82
69
  ```
83
70
 
84
71
  > ℹ️ Info:
85
- >
86
72
  > Hosted mode is the recommended production setup because the backend resolves jurisdiction and policy, keeps durable consent records, and lets c15t recover from temporary network failures by re-syncing later.
87
73
  >
88
- > ℹ️ Info:
89
- >
74
+ > ⚠️ Warning:
90
75
  > Don't have a backend yet? You can use mode: 'offline' for local-only consent storage, but it gives up backend audit history, server-side consent awareness, and automatic jurisdiction detection. Review the browser-only storage consequences before choosing it for production.
91
76
 
92
- 4. **Mount ConsentManager at the app root** Wrap your existing app tree with ConsentManager so all routes/components can access consent state.
77
+ 4. **Mount ConsentManager at the app root** Wrap your existing app tree with `ConsentManager` so all routes/components can access consent state.
93
78
 
94
79
  ```tsx
95
80
  import { ConsentManager } from './components/consent-manager';
@@ -105,7 +90,9 @@ availableIn:
105
90
 
106
91
  5. **Verify it works** Start your development server and confirm:
107
92
 
108
- A consent banner appears at the bottom of the pageClicking "Customize" opens a dialog with toggles for each consent categoryAfter accepting or rejecting, the banner dismisses and your choice persists across page reloads
93
+ 1. A **consent banner** appears at the bottom of the page
94
+ 2. Clicking **"Customize"** opens a dialog with toggles for each consent category
95
+ 3. After accepting or rejecting, the banner dismisses and your choice persists across page reloads
109
96
 
110
97
  > ℹ️ **Info:**
111
98
  > Want to improve startup performance? See Optimization for the decision guide, prefetch setup, and network tuning.
@@ -114,12 +101,7 @@ availableIn:
114
101
 
115
102
  Install DevTools only if you want a runtime inspector while building and debugging:
116
103
 
117
- |Package manager|Command|
118
- |:--|:--|
119
- |npm|`npm install @c15t/dev-tools`|
120
- |pnpm|`pnpm add @c15t/dev-tools`|
121
- |yarn|`yarn add @c15t/dev-tools`|
122
- |bun|`bun add @c15t/dev-tools`|
104
+ <PackageCommandTabs mode="install" command="@c15t/dev-tools" />
123
105
 
124
106
  Then add it inside your existing provider:
125
107
 
@@ -143,13 +125,15 @@ import { DevTools } from '@c15t/dev-tools/react';
143
125
 
144
126
  Install c15t agent skills to let AI agents help with styling, i18n, scripts & other configuration.
145
127
 
146
- |Package manager|Command|
147
- |:--|:--|
148
- |npm|`npx @c15t/cli skills`|
149
- |pnpm|`pnpm dlx @c15t/cli skills`|
150
- |yarn|`yarn dlx @c15t/cli skills`|
151
- |bun|`bunx @c15t/cli skills`|
128
+ <PackageCommandTabs command="@c15t/cli skills" />
152
129
 
153
130
  See [AI Agents](/docs/ai-agents) for bundled package docs and agent skills.
154
131
 
155
132
  ## Next steps
133
+
134
+ * [Optimization](/docs/frameworks/react/optimization)
135
+ * [Script Loader](/docs/frameworks/react/script-loader)
136
+ * [Styling](/docs/frameworks/react/styling/overview)
137
+ * [Consent Categories](/docs/frameworks/react/concepts/consent-categories)
138
+ * [Components](/docs/frameworks/react/components/consent-banner)
139
+ * [AI Agents](/docs/ai-agents)
@@ -1,22 +1,20 @@
1
1
  ---
2
2
  title: Script Loader
3
- description: Gate third-party scripts behind consent in React — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
3
+ description: Gate third-party scripts behind consent in React — load Google
4
+ Analytics, Meta Pixel, and other tracking scripts only when users grant
5
+ permission.
6
+ group: frameworks
4
7
  ---
5
8
  The script loader manages third-party JavaScript based on consent state. You declare scripts in your provider's `scripts` option, and c15t decides when each script should load, stay loaded, unload, or receive a consent update.
6
9
 
7
10
  Use it for analytics, pixels, tag managers, product analytics, and other vendor snippets that should not run until the right consent condition is satisfied. Prebuilt helpers live in [`@c15t/scripts`](/docs/integrations/overview); custom scripts can be declared directly when the vendor is specific to your app.
8
11
 
9
- |Package manager|Command|
10
- |:--|:--|
11
- |npm|`npm install @c15t/scripts`|
12
- |pnpm|`pnpm add @c15t/scripts`|
13
- |yarn|`yarn add @c15t/scripts`|
14
- |bun|`bun add @c15t/scripts`|
12
+ <PackageCommandTabs mode="install" command="@c15t/scripts" />
15
13
 
16
14
  > ℹ️ **Info:**
17
15
  > Start with the integrations overview before writing your own script. Built-in helpers encode vendor boot order, consent updates, and common defaults so you do not have to.
18
16
  >
19
- > ℹ️ **Info:**
17
+ > 📝 **Note:**
20
18
  > If you need a vendor c15t does not ship yet, see the custom integration guide. It explains when a one-off Script is enough and when to build a reusable manifest-backed helper.
21
19
  >
22
20
  > ℹ️ **Info:**
@@ -184,6 +182,8 @@ Some vendors are not just script tags. YouTube embeds, maps, calendars, and chec
184
182
 
185
183
  * For iframe-only embeds, gate the iframe `src` with the [iframe blocking](/docs/frameworks/react/iframe-blocking) pattern instead of loading a script just to hide an iframe.
186
184
  * For SDK-backed UI, use the script loader for the shared SDK and render the component only when consent and SDK readiness agree.
185
+ * Use `YouTubeEmbed` for the iframe-only YouTube candidate and `GoogleMap` for the callback-based SDK candidate.
186
+ * Use `useConsentScript()` when building custom wrappers. It registers scripts through the consent store, follows `loadedScripts`, and returns a promise-shaped readiness contract for callback-based SDKs.
187
187
 
188
188
  ## Lifecycle Callbacks
189
189
 
@@ -296,6 +296,8 @@ Control where the script is injected and whether the element id is anonymized:
296
296
 
297
297
  Set `anonymizeId: false` only when another script or test needs a stable DOM id. Pass `nonce` when your CSP requires it; c15t applies it directly to the generated `<script>` element.
298
298
 
299
+ You usually do not need a per-script `nonce`. Setting `nonce` once on the provider covers every injected script (and the theme stylesheet); a per-script value overrides it for that script alone.
300
+
299
301
  ## Dynamic Management
300
302
 
301
303
  Framework packages expose script-manager methods so integrations can be added, removed, or inspected at runtime. Use this for tenant-specific tools, feature-flagged scripts, or vendors that are configured after sign-in:
@@ -418,91 +420,136 @@ export function TenantAnalytics({ siteId }: { siteId: string }) {
418
420
 
419
421
  Some vendors need a render surface as well as a script — maps, video players, calendars, and checkout widgets all fall in this bucket.
420
422
 
421
- Split the problem into three layers:
423
+ Use the built-in [Google Maps](/docs/integrations/google-maps) and
424
+ [YouTube](/docs/integrations/youtube) renderable helpers when they fit:
425
+
426
+ ```tsx
427
+ import { GoogleMap, YouTubeEmbed } from '@c15t/react';
428
+
429
+ function Page() {
430
+ const googleMapsApiKey = import.meta.env.VITE_GOOGLE_MAPS_API_KEY;
431
+
432
+ return (
433
+ <>
434
+ {googleMapsApiKey && (
435
+ <GoogleMap
436
+ apiKey={googleMapsApiKey}
437
+ authReferrerPolicy="origin"
438
+ center={{ lat: 40.7128, lng: -74.006 }}
439
+ className="overflow-hidden rounded-xl"
440
+ consentCategory="measurement"
441
+ mapId="YOUR_MAP_ID"
442
+ zoom={12}
443
+ />
444
+ )}
445
+
446
+ <YouTubeEmbed
447
+ consentCategory="marketing"
448
+ params={{ controls: true, playsinline: true }}
449
+ title="Product demo"
450
+ videoId="dQw4w9WgXcQ"
451
+ />
452
+ </>
453
+ );
454
+ }
455
+ ```
456
+
457
+ The design splits the problem into three layers:
422
458
 
423
459
  1. Use the script loader to gate and load the shared SDK once.
424
- 2. Use React state (or a custom hook) to render a placeholder until consent is granted.
460
+ 2. Use `useConsentScript()` for SDK readiness when a vendor uses a callback-style loader.
425
461
  3. Create the widget instance only after the SDK is ready and clean it up on unmount.
426
462
 
427
- For iframe-only embeds, use the [iframe blocking](/docs/frameworks/react/iframe-blocking) pattern instead of loading a JavaScript SDK to hide an iframe. For SDK-backed widgets, treat the SDK as a singleton and each rendered component as its own instance.
463
+ Google Maps is SDK-backed, so `GoogleMap` registers one shared Google Maps script through the c15t script manager and waits for the callback-shaped SDK readiness signal before creating each map instance. It uses the official Google Maps types and accepts the direct-loader options `libraries`, `language`, `region`, `version`, `authReferrerPolicy`, `mapIds`, `channel`, and `solutionChannel`.
464
+
465
+ YouTube is iframe-only, so `YouTubeEmbed` builds on the existing `Frame` consent boundary instead of loading the YouTube iframe API. That keeps iframe media separate from SDK widgets and avoids a second source of truth for script readiness.
466
+
467
+ `GoogleMap` has a default height of `320px`; override `style.height` or supply a class that sets an inline-compatible height when your layout needs another size. `mapId` is construction-time configuration in the Google Maps API, so changing it recreates the map. Other controlled values such as `center`, `zoom`, and updateable `options` are applied to the existing instance.
468
+
469
+ The Maps JavaScript API is a page singleton. Before consent, c15t makes no Maps script request. After the first approved load, the SDK registration is retained for the consent-manager lifetime to avoid Google's duplicate-loader warning; map instances are still destroyed as soon as the component unmounts or consent becomes unavailable. All `GoogleMap` instances that share a `scriptId` must therefore use the same loader options. If another part of the application already loaded Maps, the component adopts that global API without injecting a second script.
470
+
471
+ `GoogleMap` reports network, timeout, constructor, and Google's global authentication failures through `onError` and `errorFallback`. Authentication errors commonly mean the browser key, billing, or allowed referrers need attention.
472
+
473
+ `YouTubeEmbed` defaults to a responsive, borderless 16:9 frame with stable
474
+ placeholder dimensions, a localized loading state, native lazy loading, and
475
+ the privacy-enhanced `youtube-nocookie.com` host. For overrides, `className` and
476
+ the forwarded ref target the iframe while `wrapperClassName` and `frameProps`
477
+ target the consent-gated `Frame`. Boolean values in `params` are serialized as
478
+ YouTube's documented `1` and `0` values.
479
+
480
+ For custom SDK-backed widgets, call `useConsentScript()` with a c15t `Script`
481
+ object. The hook uses the consent manager as the source of truth, shares
482
+ compatible registrations inside that provider, and exposes status, consent,
483
+ the ready SDK value, errors, and a promise:
484
+
485
+ ```tsx
486
+ import { useState } from 'react';
487
+ import { useConsentScript } from '@c15t/react';
488
+
489
+ export function VendorWidget() {
490
+ const [retryKey, setRetryKey] = useState(0);
491
+ const vendor = useConsentScript({
492
+ script: {
493
+ id: 'vendor-sdk',
494
+ src: 'https://cdn.example.com/sdk.js',
495
+ category: 'measurement',
496
+ },
497
+ resolveReady: () => window.vendorSdk ?? false,
498
+ registerReadyCallback: ({ resolve }) => {
499
+ window.onVendorReady = () => resolve(window.vendorSdk);
500
+
501
+ return () => {
502
+ delete window.onVendorReady;
503
+ };
504
+ },
505
+ readinessKey: 'vendor-sdk-v1',
506
+ retryKey,
507
+ timeoutMs: 10_000,
508
+ unmountBehavior: 'keep',
509
+ });
510
+
511
+ if (vendor.status === 'blocked') {
512
+ return <p>Enable Analytics consent to use this widget.</p>;
513
+ }
514
+
515
+ if (vendor.status === 'loading') {
516
+ return <p role="status">Loading widget…</p>;
517
+ }
518
+
519
+ if (vendor.status === 'error') {
520
+ return (
521
+ <div role="alert">
522
+ <p>The widget could not be loaded.</p>
523
+ <button type="button" onClick={() => setRetryKey((key) => key + 1)}>
524
+ Retry
525
+ </button>
526
+ </div>
527
+ );
528
+ }
529
+
530
+ if (vendor.status !== 'ready' || !vendor.readyValue) {
531
+ return null;
532
+ }
533
+
534
+ return <div ref={(node) => node && vendor.readyValue.mount(node)} />;
535
+ }
536
+ ```
537
+
538
+ Inline script objects and lifecycle callbacks are safe. The hook compares the complete non-function script configuration, reads callbacks from the latest render, adopts a compatible script already owned by the provider, and never removes a registration it did not create. Use `unmountBehavior: 'remove'` (the default) for route-local scripts, or `'keep'` for a genuine page-level singleton.
539
+
540
+ Change `retryKey` after a failed attempt to retry the same registration.
541
+ Consumers sharing a script id must use identical script options,
542
+ `readinessKey`, timeout, and unmount behavior. Conflicts throw
543
+ `ConsentScriptConflictError`; choose another id only when the vendor genuinely
544
+ supports multiple page-level loaders.
545
+
546
+ For iframe-only embeds, use the [iframe blocking](/docs/frameworks/react/iframe-blocking) pattern or `YouTubeEmbed` instead of loading a JavaScript SDK to hide an iframe. For SDK-backed widgets, treat the SDK as a singleton and each rendered component as its own instance.
428
547
 
429
548
  ## API Reference
430
549
 
431
- ### Script
432
-
433
- |Property|Type|Description|Default|Required|
434
- |:--|:--|:--|:--|:--:|
435
- |id|string|Unique identifier for the script|-|✅ Required|
436
- |src|string \|undefined|URL of the script to load|-|Optional|
437
- |textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
438
- |category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
439
- |callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
440
- |persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
441
- |alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
442
- |fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
443
- |attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
444
- |async|boolean \|undefined|Whether to use async loading|-|Optional|
445
- |defer|boolean \|undefined|Whether to defer script loading|-|Optional|
446
- |nonce|string \|undefined|Content Security Policy nonce|-|Optional|
447
- |anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
448
- |target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
449
- |onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
450
- |onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
451
- |onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
452
- |onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
453
- |vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
454
- |iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
455
- |iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
456
- |iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
457
-
458
- #### `onBeforeLoad`
459
-
460
- Callback executed before the script is loaded
461
-
462
- |Property|Type|Description|Default|Required|
463
- |:--|:--|:--|:--|:--:|
464
- |id|string|The original script ID|-|✅ Required|
465
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
466
- |hasConsent|boolean|Has consent|-|✅ Required|
467
- |consents|ConsentState|The current consent state|-|✅ Required|
468
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
469
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
470
-
471
- #### `onLoad`
472
-
473
- Callback executed when the script loads successfully
474
-
475
- |Property|Type|Description|Default|Required|
476
- |:--|:--|:--|:--|:--:|
477
- |id|string|The original script ID|-|✅ Required|
478
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
479
- |hasConsent|boolean|Has consent|-|✅ Required|
480
- |consents|ConsentState|The current consent state|-|✅ Required|
481
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
482
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
483
-
484
- #### `onError`
485
-
486
- Callback executed if the script fails to load
487
-
488
- |Property|Type|Description|Default|Required|
489
- |:--|:--|:--|:--|:--:|
490
- |id|string|The original script ID|-|✅ Required|
491
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
492
- |hasConsent|boolean|Has consent|-|✅ Required|
493
- |consents|ConsentState|The current consent state|-|✅ Required|
494
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
495
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
496
-
497
- #### `onConsentChange`
498
-
499
- Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
500
-
501
- |Property|Type|Description|Default|Required|
502
- |:--|:--|:--|:--|:--:|
503
- |id|string|The original script ID|-|✅ Required|
504
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
505
- |hasConsent|boolean|Has consent|-|✅ Required|
506
- |consents|ConsentState|The current consent state|-|✅ Required|
507
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
508
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
550
+ |Property|Value|
551
+ |:--|:--|
552
+ |Type Name|\`Script\`|
553
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
554
+
555
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/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: Server-Side Utilities
3
- description: Fetch consent data on the server for SSR hydration — eliminate the loading flash and improve performance.
3
+ description: Fetch consent data on the server for SSR hydration — eliminate the
4
+ loading flash and improve performance.
5
+ group: frameworks
4
6
  ---
5
7
  The `@c15t/react/server` module provides utilities for fetching consent data on the server before rendering. This enables SSR hydration — consent state is available immediately on page load without a client-side fetch, eliminating the consent banner flash.
6
8
 
@@ -36,9 +38,12 @@ const ssrData = await fetchSSRData({
36
38
 
37
39
  ### Options
38
40
 
39
- |Property|Type|Description|Default|Required|
40
- |:--|:--|:--|:--|:--:|
41
- |headers|Headers|Request headers from the framework. These should be the incoming request headers that contain geo-location information (cf-ipcountry, x-vercel-ip-country, etc.)|-|✅ Required|
41
+ |Property|Value|
42
+ |:--|:--|
43
+ |Type Name|\`FetchSSRDataOptions\`|
44
+ |Source Path|\`./packages/react/src/server/types.ts\`|
45
+
46
+ \*ExtractedTypeTable: Could not extract "FetchSSRDataOptions" from "./packages/react/src/server/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
42
47
 
43
48
  ### Return Value
44
49
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Class Names
3
- description: Style consent components using className props and per-slot className targeting via the theme.
3
+ description: Style consent components using className props and per-slot
4
+ className targeting via the theme.
5
+ group: frameworks
4
6
  ---
5
7
  ## Prefer Slots for Stock Components
6
8
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Color Scheme
3
- description: Support light mode, dark mode, and system preference detection in consent components.
3
+ description: Support light mode, dark mode, and system preference detection in
4
+ consent components.
5
+ group: frameworks
4
6
  ---
5
7
  c15t supports light and dark mode through the theme's `colors` and `dark` token groups. The active color scheme is determined by one of three methods:
6
8
 
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: CSS Variables
3
+ description: Reference for all --c15t-* CSS custom properties generated by the theme system.
4
+ group: frameworks
5
+ ---
6
+ Every theme token is converted to a `--c15t-*` CSS custom property at runtime. You can override these variables in your stylesheet without using the JavaScript theme API.
7
+
8
+ ## Variable Reference
9
+
10
+ |Property|Value|
11
+ |:--|:--|
12
+ |Type Name|\`ThemeCSSVariables\`|
13
+ |Source Path|\`./packages/ui/src/theme/types.ts\`|
14
+
15
+ \*ExtractedTypeTable: Could not extract "ThemeCSSVariables" 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.\*
16
+
17
+ ## Overriding Variables
18
+
19
+ Override in your stylesheet:
20
+
21
+ ```css
22
+ :root {
23
+ --c15t-primary: #8b5cf6;
24
+ --c15t-surface: #fafafa;
25
+ --c15t-radius-md: 1rem;
26
+ }
27
+
28
+ /* Dark mode overrides */
29
+ .dark,
30
+ .c15t-dark {
31
+ --c15t-primary: #a78bfa;
32
+ --c15t-surface: #18181b;
33
+ --c15t-text: #fafafa;
34
+ }
35
+ ```
36
+
37
+ ## Scoped Overrides
38
+
39
+ Target specific components by scoping variables:
40
+
41
+ ```tsx
42
+ <div className="checkout-consent">
43
+ <ConsentBanner />
44
+ </div>
45
+ ```
46
+
47
+ ```css
48
+ /* Only affect c15t components inside .checkout-consent */
49
+ .checkout-consent {
50
+ --c15t-surface: #f0f9ff;
51
+ --c15t-radius-lg: 1.5rem;
52
+ }
53
+ ```