diff --git a/examples/cookie-banner-react/index.html b/examples/cookie-banner-react/index.html new file mode 100644 index 000000000..3f854ed16 --- /dev/null +++ b/examples/cookie-banner-react/index.html @@ -0,0 +1,12 @@ + + +
+ + ++ SDK example — React +
+ + + + {activeTab === "config" &&+ Set the banner ID and base URL for the cookie banner API. These values + are persisted to localStorage and used by every other tab. +
+ +
+ {JSON.stringify(config, null, 2)}
+
+
+ {JSON.stringify(
+ { ready: snapshot.ready, hasResponse: snapshot.hasResponse },
+ null,
+ 2,
+ )}
+
+
+ {Object.keys(snapshot.data).length === 0 ? (
+ + No consent data yet. Interact with the banner to generate consent. +
+ ) : ( +| + Category + | ++ has() + | +
|---|---|
| {cat} | ++ {String(granted)} + | +
+ {visitorId ?? "(not set)"}
+
+
+ {cookie
+ ? JSON.stringify(JSON.parse(cookie), null, 2)
+ : "(not set)"}
+
+ + Set banner ID and base URL in the Config tab first. +
+
+ Uses registerHeadlessComponents() and renders raw headless
+ elements with no themed styling. Borders show element boundaries.
+
No events yet.
+ ) : ( + events.map((ev, i) => ( +
+ {JSON.stringify(ev.detail, null, 2)}
+
+ + Set banner ID and base URL in the Config tab first. +
+
+ Uses registerCookieBanner() and renders{" "}
+ <probo-cookie-banner>. The banner appears in the
+ bottom-right corner.
+
No events yet.
+ ) : ( + events.map((ev, i) => ( +
+ {JSON.stringify(ev.detail, null, 2)}
+
+