@c15t/nextjs 2.2.1 → 3.0.0-alpha.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 (221) hide show
  1. package/AGENTS.md +103 -142
  2. package/README.md +4 -4
  3. package/dist/api.js +1 -0
  4. package/dist/config.js +1 -0
  5. package/dist/devtools.js +2 -0
  6. package/dist/headers.js +1 -0
  7. package/dist/iab/styles.css +1 -1
  8. package/dist/iab/styles.tw3.css +27 -19
  9. package/dist/index.js +1 -1
  10. package/dist/middleware.js +1 -0
  11. package/dist/node-bridge.js +1 -0
  12. package/dist/pages.js +1 -0
  13. package/dist/proxy.js +1 -0
  14. package/dist/root.js +2 -0
  15. package/dist/server.js +1 -0
  16. package/dist/static.js +1 -0
  17. package/dist/styles.css +1 -1
  18. package/dist/styles.tw3.css +67 -29
  19. package/dist/version.js +1 -1
  20. package/dist-types/api.d.ts +88 -0
  21. package/dist-types/config.d.ts +110 -0
  22. package/dist-types/devtools.d.ts +1 -0
  23. package/dist-types/headers.d.ts +4 -0
  24. package/dist-types/index.d.ts +28 -10
  25. package/dist-types/middleware.d.ts +15 -0
  26. package/dist-types/node-bridge.d.ts +57 -0
  27. package/dist-types/pages.d.ts +88 -0
  28. package/dist-types/proxy.d.ts +34 -0
  29. package/dist-types/root.d.ts +92 -0
  30. package/dist-types/server.d.ts +164 -0
  31. package/dist-types/static.d.ts +42 -0
  32. package/dist-types/types.d.ts +5 -36
  33. package/dist-types/version.d.ts +1 -1
  34. package/docs/README.md +103 -142
  35. package/docs/assets/v3/brand-bar.png +0 -0
  36. package/docs/assets/v3/brand-card.png +0 -0
  37. package/docs/assets/v3/choice-wall.png +0 -0
  38. package/docs/assets/v3/mobile-card.png +0 -0
  39. package/docs/assets/v3/preferences.png +0 -0
  40. package/docs/customization/overview.md +45 -0
  41. package/docs/customization/recipes.md +79 -0
  42. package/docs/customization/slots.md +55 -0
  43. package/docs/customization/tokens.md +76 -0
  44. package/docs/customization/translations.md +49 -0
  45. package/docs/frameworks/next/api-reference/data-fetching.md +416 -0
  46. package/docs/frameworks/next/app-router.md +403 -0
  47. package/docs/frameworks/next/client-side.md +118 -0
  48. package/docs/frameworks/next/components/consent-banner.md +251 -211
  49. package/docs/frameworks/next/components/consent-dialog-link.md +96 -35
  50. package/docs/frameworks/next/components/consent-dialog-trigger.md +74 -149
  51. package/docs/frameworks/next/components/consent-dialog.md +189 -134
  52. package/docs/frameworks/next/components/consent-manager-provider.md +68 -318
  53. package/docs/frameworks/next/components/consent-widget.md +172 -114
  54. package/docs/frameworks/next/components/dev-tools.md +199 -40
  55. package/docs/frameworks/next/components/frame.md +137 -42
  56. package/docs/frameworks/next/concepts/consent-categories.md +24 -89
  57. package/docs/frameworks/next/concepts/policy-presets.md +142 -0
  58. package/docs/frameworks/next/content-security-policy.md +189 -0
  59. package/docs/frameworks/next/data-fetching.md +74 -0
  60. package/docs/frameworks/next/geography-headers.md +251 -0
  61. package/docs/frameworks/next/headless.md +95 -185
  62. package/docs/frameworks/next/hooks/use-consent-manager/overview.md +42 -163
  63. package/docs/frameworks/next/iab/overview.md +37 -107
  64. package/docs/frameworks/next/optimization.md +158 -194
  65. package/docs/frameworks/next/pages-router.md +296 -0
  66. package/docs/frameworks/next/quickstart.md +31 -132
  67. package/docs/frameworks/next/script-loader.md +140 -465
  68. package/docs/frameworks/next/server-side.md +97 -130
  69. package/docs/frameworks/next/static-export.md +164 -0
  70. package/docs/frameworks/next/styling/overview.md +174 -248
  71. package/docs/frameworks/next/troubleshooting.md +134 -144
  72. package/docs/guides/consent-state.md +60 -0
  73. package/docs/guides/data-fetching.md +163 -0
  74. package/docs/guides/deployment-modes.md +63 -0
  75. package/docs/guides/troubleshooting.md +68 -0
  76. package/docs/guides/verify-consent.md +62 -0
  77. package/docs/integrations/adobe-analytics.md +239 -105
  78. package/docs/integrations/ahrefs-analytics.md +238 -104
  79. package/docs/integrations/amplitude.md +219 -157
  80. package/docs/integrations/building-integrations.md +32 -224
  81. package/docs/integrations/clear-on-revocation.md +167 -0
  82. package/docs/integrations/clearbit.md +247 -86
  83. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  84. package/docs/integrations/crisp.md +251 -97
  85. package/docs/integrations/databuddy.md +259 -153
  86. package/docs/integrations/fathom-analytics.md +239 -96
  87. package/docs/integrations/google-maps.md +328 -207
  88. package/docs/integrations/google-tag-manager.md +248 -96
  89. package/docs/integrations/google-tag.md +261 -90
  90. package/docs/integrations/heap.md +222 -149
  91. package/docs/integrations/hightouch.md +225 -131
  92. package/docs/integrations/hotjar.md +239 -90
  93. package/docs/integrations/intercom.md +239 -98
  94. package/docs/integrations/linkedin-insights.md +243 -113
  95. package/docs/integrations/logrocket.md +241 -123
  96. package/docs/integrations/matomo-analytics.md +256 -111
  97. package/docs/integrations/meta-pixel.md +197 -324
  98. package/docs/integrations/microsoft-clarity.md +233 -114
  99. package/docs/integrations/microsoft-uet.md +245 -110
  100. package/docs/integrations/mixpanel-analytics.md +252 -87
  101. package/docs/integrations/openai-pixel.md +441 -0
  102. package/docs/integrations/overview.md +95 -133
  103. package/docs/integrations/pirsch.md +249 -96
  104. package/docs/integrations/plausible-analytics.md +241 -100
  105. package/docs/integrations/posthog.md +353 -214
  106. package/docs/integrations/promptwatch.md +251 -81
  107. package/docs/integrations/reddit-pixel.md +226 -173
  108. package/docs/integrations/rudderstack.md +244 -187
  109. package/docs/integrations/rybbit-analytics.md +244 -91
  110. package/docs/integrations/segment.md +238 -92
  111. package/docs/integrations/snapchat-pixel.md +240 -110
  112. package/docs/integrations/tiktok-pixel.md +249 -81
  113. package/docs/integrations/umami-analytics.md +242 -95
  114. package/docs/integrations/vercel-analytics.md +242 -90
  115. package/docs/integrations/x-pixel.md +238 -104
  116. package/docs/integrations/youtube.md +354 -142
  117. package/docs/upgrade-v3.md +334 -0
  118. package/iab/styles.css +1 -1
  119. package/iab/styles.tw3.css +1 -1
  120. package/package.json +106 -65
  121. package/readme.json +3 -3
  122. package/src/iab/styles.css +1 -1
  123. package/src/iab/styles.tw3.css +1 -1
  124. package/src/styles.css +1 -1
  125. package/src/styles.tw3.css +1 -1
  126. package/styles.css +1 -1
  127. package/styles.tw3.css +1 -1
  128. package/client/components/consent-dialog-link.js +0 -3
  129. package/client/components/integrations.js +0 -3
  130. package/dist/components/integrations/index.cjs +0 -1
  131. package/dist/components/integrations/index.js +0 -1
  132. package/dist/headless.cjs +0 -1
  133. package/dist/index.cjs +0 -1
  134. package/dist/libs/browser-initial-data.cjs +0 -1
  135. package/dist/libs/browser-initial-data.js +0 -1
  136. package/dist/libs/initial-data.cjs +0 -1
  137. package/dist/libs/initial-data.js +0 -1
  138. package/dist/types.cjs +0 -1
  139. package/dist/version.cjs +0 -1
  140. package/dist-types/components/integrations/index.d.ts +0 -1
  141. package/dist-types/libs/browser-initial-data.d.ts +0 -9
  142. package/dist-types/libs/initial-data.d.ts +0 -33
  143. package/docs/frameworks/next/building-headless-components.md +0 -379
  144. package/docs/frameworks/next/callbacks.md +0 -186
  145. package/docs/frameworks/next/concepts/client-modes.md +0 -177
  146. package/docs/frameworks/next/concepts/consent-models.md +0 -117
  147. package/docs/frameworks/next/concepts/cookie-management.md +0 -122
  148. package/docs/frameworks/next/concepts/glossary.md +0 -24
  149. package/docs/frameworks/next/concepts/initialization-flow.md +0 -149
  150. package/docs/frameworks/next/concepts/policy-packs.md +0 -230
  151. package/docs/frameworks/next/hooks/use-color-scheme.md +0 -41
  152. package/docs/frameworks/next/hooks/use-consent-manager/checking-consent.md +0 -96
  153. package/docs/frameworks/next/hooks/use-consent-manager/location-info.md +0 -97
  154. package/docs/frameworks/next/hooks/use-consent-manager/setting-consent.md +0 -94
  155. package/docs/frameworks/next/hooks/use-draggable.md +0 -59
  156. package/docs/frameworks/next/hooks/use-focus-trap.md +0 -42
  157. package/docs/frameworks/next/hooks/use-reduced-motion.md +0 -37
  158. package/docs/frameworks/next/hooks/use-ssr-status.md +0 -32
  159. package/docs/frameworks/next/hooks/use-text-direction.md +0 -50
  160. package/docs/frameworks/next/hooks/use-translations.md +0 -55
  161. package/docs/frameworks/next/iab/consent-banner.md +0 -91
  162. package/docs/frameworks/next/iab/consent-dialog.md +0 -129
  163. package/docs/frameworks/next/iab/use-gvl-data.md +0 -21
  164. package/docs/frameworks/next/iframe-blocking.md +0 -106
  165. package/docs/frameworks/next/internationalization.md +0 -207
  166. package/docs/frameworks/next/network-blocker.md +0 -140
  167. package/docs/frameworks/next/policy-packs.md +0 -248
  168. package/docs/frameworks/next/styling/classnames.md +0 -94
  169. package/docs/frameworks/next/styling/color-scheme.md +0 -84
  170. package/docs/frameworks/next/styling/css-variables.md +0 -53
  171. package/docs/frameworks/next/styling/slots.md +0 -94
  172. package/docs/frameworks/next/styling/tailwind.md +0 -137
  173. package/docs/frameworks/next/styling/tokens.md +0 -156
  174. package/docs/shared/concepts/client-modes.md +0 -103
  175. package/docs/shared/concepts/consent-categories.md +0 -41
  176. package/docs/shared/concepts/consent-models.md +0 -72
  177. package/docs/shared/concepts/cookie-management.md +0 -88
  178. package/docs/shared/concepts/glossary.md +0 -24
  179. package/docs/shared/concepts/initialization-flow.md +0 -105
  180. package/docs/shared/concepts/policy-packs.md +0 -225
  181. package/docs/shared/react/components/consent-banner.md +0 -242
  182. package/docs/shared/react/components/consent-dialog-link.md +0 -45
  183. package/docs/shared/react/components/consent-dialog-trigger.md +0 -185
  184. package/docs/shared/react/components/consent-dialog.md +0 -119
  185. package/docs/shared/react/components/consent-manager-provider.md +0 -225
  186. package/docs/shared/react/components/consent-widget.md +0 -121
  187. package/docs/shared/react/components/dev-tools.md +0 -81
  188. package/docs/shared/react/components/frame.md +0 -52
  189. package/docs/shared/react/guides/building-headless-components.md +0 -110
  190. package/docs/shared/react/guides/callbacks.md +0 -89
  191. package/docs/shared/react/guides/headless.md +0 -31
  192. package/docs/shared/react/guides/iframe-blocking.md +0 -65
  193. package/docs/shared/react/guides/internationalization.md +0 -123
  194. package/docs/shared/react/guides/network-blocker.md +0 -72
  195. package/docs/shared/react/guides/optimization.md +0 -44
  196. package/docs/shared/react/guides/policy-packs.md +0 -173
  197. package/docs/shared/react/guides/script-loader.md +0 -311
  198. package/docs/shared/react/hooks/use-color-scheme.md +0 -31
  199. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +0 -95
  200. package/docs/shared/react/hooks/use-consent-manager/location-info.md +0 -96
  201. package/docs/shared/react/hooks/use-consent-manager/overview.md +0 -74
  202. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +0 -93
  203. package/docs/shared/react/hooks/use-draggable.md +0 -30
  204. package/docs/shared/react/hooks/use-focus-trap.md +0 -20
  205. package/docs/shared/react/hooks/use-reduced-motion.md +0 -33
  206. package/docs/shared/react/hooks/use-ssr-status.md +0 -16
  207. package/docs/shared/react/hooks/use-text-direction.md +0 -38
  208. package/docs/shared/react/hooks/use-translations.md +0 -15
  209. package/docs/shared/react/iab/consent-banner.md +0 -60
  210. package/docs/shared/react/iab/consent-dialog.md +0 -76
  211. package/docs/shared/react/iab/overview.md +0 -80
  212. package/docs/shared/react/iab/use-gvl-data.md +0 -21
  213. package/docs/shared/react/styling/classnames.md +0 -93
  214. package/docs/shared/react/styling/color-scheme.md +0 -35
  215. package/docs/shared/react/styling/css-variables.md +0 -53
  216. package/docs/shared/react/styling/overview.md +0 -261
  217. package/docs/shared/react/styling/slots.md +0 -93
  218. package/docs/shared/react/styling/stylesheet-entrypoint.md +0 -8
  219. package/docs/shared/react/styling/tailwind.md +0 -88
  220. package/docs/shared/react/styling/tokens.md +0 -155
  221. package/docs/shared/troubleshooting.md +0 -82
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: Customize your consent interface
3
+ description: Choose presentation, theme tokens, slots or custom markup for the
4
+ change you need.
5
+ group: customization
6
+ ---
7
+
8
+ ## Start with the change you want
9
+
10
+ | Change | Use | Why |
11
+ | ----------------------------------------- | ----------------------------------- | ------------------------------------------------------------ |
12
+ | Banner shape or location | Presentation or banner props | Keeps policy actions and built-in layout behavior |
13
+ | Brand colors, radius, typography, spacing | Theme tokens | Changes related component parts together |
14
+ | One card, footer, title or button group | Component slots | Targets existing markup |
15
+ | Labels, descriptions or language | i18n configuration | Keeps banner and preferences copy consistent |
16
+ | A different component structure | Compound components where available | Retains the component behavior while changing markup |
17
+ | Your own interaction and markup | Headless APIs | You own rendering, focus behavior and policy action coverage |
18
+
19
+ Most brand changes need tokens and a few slots. Start there before opting out
20
+ of the stock styles. The [recipes](./recipes.md) show how each
21
+ choice affects a real banner.
22
+
23
+ ## Keep behavior and appearance separate
24
+
25
+ Presentation controls the prompt's shape, position and blocking behavior.
26
+ Policy controls which actions and rights are required. Changing colors or button
27
+ order does not change a saved choice or policy scope.
28
+
29
+ A choice wall always blocks. Notices never block and cannot become a wall merely
30
+ because `variant: 'wall'` was requested. Preference dialogs remain centered;
31
+ prompt positioning does not move them. Required actions omitted from a custom
32
+ layout can be restored by the policy renderer.
33
+
34
+ ## Use the adapter's configuration shape
35
+
36
+ React and Next.js accept provider `theme`, `presentation` and `components`
37
+ options. Vue and Nuxt expose their own shared configuration, including CSS
38
+ `tokens` and component slots. Svelte accepts its provider options and theme
39
+ contract. Astro serializes integration options and uses the selected adapter for
40
+ dialogs. Do not move a configuration object between frameworks without checking
41
+ the target types.
42
+
43
+ Read [tokens and CSS](./tokens.md),
44
+ [slots](./slots.md) or
45
+ [copy and translations](./translations.md) for the next step.
@@ -0,0 +1,79 @@
1
+ ---
2
+ title: Banner styling recipes
3
+ description: See real v3 components and reuse the exact theme configuration
4
+ behind the examples.
5
+ group: customization
6
+ ---
7
+
8
+ ## A branded floating card
9
+
10
+ This theme uses a green primary action and a four-pixel large radius. Accept and
11
+ Reject keep matching treatment. The component's required action behavior stays
12
+ intact.
13
+
14
+ ![A v3 floating consent card with green Customize action, matching Accept and Reject buttons, and compact corners](../assets/v3/brand-card.png)
15
+
16
+ ```ts
17
+ import { defineTheme } from '@c15t/ui/theme';
18
+
19
+ export const brandTheme = defineTheme({
20
+ colors: { primary: '#2f6f4e' },
21
+ consentActions: {
22
+ primary: { mode: 'filled', variant: 'primary' },
23
+ },
24
+ radius: { lg: '4px' },
25
+ });
26
+
27
+ ```
28
+
29
+ Install `@c15t/ui` to use `defineTheme` directly. Pass `brandTheme` as `theme` in
30
+ your existing React or Next.js provider options. Keep your Inth mode and script
31
+ configuration. The theme source above is also imported by the runnable example,
32
+ so the rendered result and the documentation use the same values.
33
+
34
+ ## Change the shape without rebuilding the banner
35
+
36
+ ```tsx
37
+ <ConsentBanner variant="bar" />
38
+ ```
39
+
40
+ ![The same green theme on a full-width v3 consent bar with the actions arranged across its footer](../assets/v3/brand-bar.png)
41
+
42
+ A bar changes the prompt's footprint. It does not change policy, grant categories
43
+ or require a headless implementation.
44
+
45
+ ```tsx
46
+ <ConsentBanner variant="wall" />
47
+ ```
48
+
49
+ ![A centered v3 choice wall with a backdrop, using the same green action theme](../assets/v3/choice-wall.png)
50
+
51
+ A choice wall blocks interaction with the page. A notice never blocks; requesting
52
+ a wall for a notice falls back to a non-blocking presentation.
53
+
54
+ ## Carry the theme into preferences
55
+
56
+ ![The v3 preferences dialog with optional category toggles and a green Save Settings action](../assets/v3/preferences.png)
57
+
58
+ Keep a preferences link after the banner closes. Test a reject action, reopen
59
+ the dialog, change one category and save. A branded prompt is only part of the
60
+ consent flow.
61
+
62
+ ## Check narrow screens
63
+
64
+ ![The branded v3 floating card at a 375-pixel viewport, with Accept and Reject sharing a row and Customize below](../assets/v3/mobile-card.png)
65
+
66
+ This example fits a 375-pixel viewport without horizontal overflow. Test your
67
+ own longest translations and font settings before adopting the same sizing.
68
+
69
+ ## Run the examples
70
+
71
+ The source repository contains resettable Storybook examples under
72
+ `Docs / Customization`: Brand Card, Brand Bar and Choice Wall. Each demo uses
73
+ in-memory consent and no analytics; Reset example returns it to a fresh choice.
74
+ The screenshots above come from these v3 examples.
75
+
76
+ The stories are suitable for isolated iframe previews on a version-matched
77
+ Storybook deployment. Keep source code and the explanation on this page when
78
+ embedding them, so the recipe remains usable in Markdown and offline package
79
+ docs. A live preview must use the same v3 revision as the documentation.
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: Style component slots
3
+ description: Target a specific c15t component part without replacing its markup or behavior.
4
+ group: customization
5
+ ---
6
+
7
+ ## Use slots for local changes
8
+
9
+ In React and Next.js, put per-part attributes in `options.components`. This
10
+ fragment belongs in an existing provider's options:
11
+
12
+ ```tsx
13
+ components: {
14
+ banner: {
15
+ card: { className: 'rounded-none shadow-none' },
16
+ title: { className: 'font-semibold' },
17
+ footer: { className: 'border-t' },
18
+ },
19
+ }
20
+ ```
21
+
22
+ The class names above assume Tailwind. A slot can also receive `style` and other
23
+ supported element attributes. Keep shared colors and radius scales in tokens;
24
+ use slots when only one component part should change.
25
+
26
+ ## Read attributes on the right element
27
+
28
+ The banner root carries `data-prompt`, `data-model`, `data-variant`,
29
+ `data-position` and `data-blocking`. Its child card does not inherit those HTML
30
+ attributes. In Tailwind, give the root `className: 'group'` and use
31
+ `group-data-[variant=bar]:...` on a child slot.
32
+
33
+ | React banner slot | Use |
34
+ | ---------------------------------- | ------------------------------------- |
35
+ | `root` | Position wrapper and state attributes |
36
+ | `cardShell` | Card sizing and branding container |
37
+ | `card` | Visible card |
38
+ | `header`, `title`, `description` | Heading and explanatory copy |
39
+ | `footer`, `actions`, `actionGroup` | Action layout |
40
+ | `rights`, `rightLink` | Preferences access controls |
41
+ | `overlay` | Backdrop for blocking presentation |
42
+
43
+ Buttons expose `data-action` for action-specific CSS. Test notices as well as
44
+ choice prompts; a notice uses acknowledgement rather than accept/reject.
45
+
46
+ ## When to remove styles
47
+
48
+ `noStyle` removes the built-in component styling. It does not supply replacement
49
+ layout, spacing, focus indicators or responsive behavior. Use it when you intend
50
+ to own all of that work, not as the first response to a token that appears to do
51
+ nothing.
52
+
53
+ If the markup itself must change, use the adapter's compound components or
54
+ headless API. The slot objects above are the React contract; check Vue and Svelte
55
+ slot types before reusing them.
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: Theme tokens and CSS
3
+ description: Style c15t with semantic tokens and use the stylesheet that matches
4
+ your CSS tooling.
5
+ group: customization
6
+ ---
7
+
8
+ ## Load the stock stylesheet once
9
+
10
+ React, Next.js and Svelte provide `styles.css`. Import the adapter's stylesheet
11
+ at the app's global entry point. Vue includes styles in its components; Astro
12
+ adds styles through its integration.
13
+
14
+ ```tsx
15
+ import 'c15t/react/styles.css';
16
+ ```
17
+
18
+ The standard stylesheet places rules in `@layer components`. For Tailwind 3,
19
+ use the `styles.tw3.css` entry instead of the standard stylesheet, between the
20
+ components and utilities directives in your Tailwind entry:
21
+
22
+ ```css
23
+ @tailwind base;
24
+ @tailwind components;
25
+ @import 'c15t/react/styles.tw3.css';
26
+ @tailwind utilities;
27
+ ```
28
+
29
+ Do not load both c15t stylesheet variants. For Tailwind 4 or unlayered CSS,
30
+ inspect layer order before reaching for `!important`.
31
+
32
+ ## Set semantic values together
33
+
34
+ This React theme changes the brand color and large corner radius. Include
35
+ hover and foreground colors when overriding raw variables so the button remains
36
+ readable in each state.
37
+
38
+ ```ts
39
+ import { defineTheme } from '@c15t/ui/theme';
40
+
41
+ export const theme = defineTheme({
42
+ colors: { primary: '#2f6f4e' },
43
+ radius: { lg: '4px' },
44
+ consentActions: {
45
+ primary: { variant: 'primary', mode: 'filled' },
46
+ dismiss: { variant: 'neutral', mode: 'stroke' },
47
+ },
48
+ });
49
+ ```
50
+
51
+ Install `@c15t/ui` if importing its theme helper directly. Pass `theme` in your
52
+ provider options. `consentActions` selects styling by action role. A per-action
53
+ entry overrides `primary`, which overrides `default`.
54
+
55
+ ## Target a prompt with CSS
56
+
57
+ ```css
58
+ [data-prompt][data-model='opt-in'] {
59
+ --c15t-primary: #2f6f4e;
60
+ --c15t-primary-hover: #24563c;
61
+ --c15t-text-on-primary: #fff;
62
+ }
63
+ ```
64
+
65
+ Use attributes exposed by the rendered component, not guessed class names.
66
+ Test the prompt and the preferences dialog separately because tokens scoped to
67
+ one prompt do not automatically reach a portaled dialog.
68
+
69
+ | Size variable | Default | Target |
70
+ | ----------------------------------- | ------- | ------------- |
71
+ | `--consent-banner-max-width` | `440px` | Floating card |
72
+ | `--consent-banner-widget-max-width` | `20rem` | Widget |
73
+ | `--consent-banner-wall-max-width` | `30rem` | Choice wall |
74
+
75
+ Test long translations and small screens after changing width or typography.
76
+ A compact banner must still fit the required actions.
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Copy and translations
3
+ description: Change consent wording through i18n and test the complete prompt
4
+ and preferences flow.
5
+ group: customization
6
+ ---
7
+
8
+ ## Configure shared messages
9
+
10
+ Use provider `i18n` for wording that should stay consistent across components.
11
+ For React, this fragment belongs in `ConsentProvider` options:
12
+
13
+ ```tsx
14
+ i18n: {
15
+ messages: {
16
+ en: {
17
+ common: {
18
+ acceptAll: 'Accept all',
19
+ rejectAll: 'Reject optional',
20
+ customize: 'Choose cookies',
21
+ acknowledge: 'Got it',
22
+ },
23
+ },
24
+ },
25
+ }
26
+ ```
27
+
28
+ Supply the same message keys in each supported locale. A one-off component prop
29
+ such as `dismissButtonText` is useful for one banner; use translations for a
30
+ site-wide change. Astro's serializable integration options and Vue's module
31
+ configuration have their own types, so verify those shapes before copying a
32
+ React object.
33
+
34
+ ## Write labels that describe the action
35
+
36
+ Accept and Reject record a choice. Customize opens preferences. Acknowledge
37
+ dismisses a notice and does not record a grant. Do not label a notice dismissal
38
+ "Accept all" or make a preferences link sound like it submits an opt-out.
39
+
40
+ The notice acknowledgement uses `common.acknowledge`, with `common.dismiss` as
41
+ a fallback for older translation bundles. Keep the displayed label and the
42
+ command's effect aligned.
43
+
44
+ ## Test more than English
45
+
46
+ Try the longest labels you support at a narrow width, with browser zoom and
47
+ right-to-left text where relevant. Check banner actions, category descriptions,
48
+ legal links and the preferences save action. Translate explanations as well as
49
+ buttons so a visitor can make an informed choice.