Introduction
VS Cookies
Section titled “VS Cookies”A minimal, headless-first cookie consent library built as a small runtime plus one skin per banner. The runtime owns consent, the skin registry and the token contract; a skin is a single banner shipped as its own zip.
- Headless core — one small
ConsentStore, bundled into both runtimes. - Design tokens — every skin reads CSS variables (
--vsc-*); both runtimes expose the token contract for live overrides. - React runtime + skins —
@vscookies/reactplus@vscookies/skin-<slug>-react. - Vanilla runtime + skins —
@vscookies/vanillaplus@vscookies/skin-<slug>-vanilla, as Web Components for any stack.
Tailwind is configured across the docs site and every skin source. Semantic
utilities such as bg-surface map directly to
—vsc-* tokens.
Packages
Section titled “Packages”Distributed as zip archives from the VS GOODS store — see Installing from the zip to add them to your project.
| Package | What it is | Use it when |
|---|---|---|
@vscookies/react | React runtime: headless consent, skin registry, token contract (bundles core + tokens) | You are building in React |
@vscookies/skin-<slug>-react | One React banner skin (minimalist, edito) | You want a ready-made React banner |
@vscookies/vanilla | Web Component runtime: skin registry, bundled React + core + tokens + headless provider | You are not using React |
@vscookies/skin-<slug>-vanilla | One banner skin as a custom element | You want a ready-made banner on any stack |
@vscookies/core | Headless store + cookie helpers | You want full control or a custom UI |
@vscookies/tokens | Design tokens (CSS vars + TS) | You want to style things yourself |
The runtimes already bundle @vscookies/core and @vscookies/tokens; download
those zips separately only when building a fully custom UI.
Quick starts
Section titled “Quick starts”React (runtime + skin)
Section titled “React (runtime + skin)”import { CookieConsentProvider } from "@vscookies/react";import { MinimalistBanner } from "@vscookies/skin-minimalist-react";
export default function App() { return ( <CookieConsentProvider> <MinimalistBanner mode="light" /> </CookieConsentProvider> );}The skin self-registers on import. You can mount several skins — they all share
one consent store via useSyncExternalStore.
React headless (your own UI)
Section titled “React headless (your own UI)”import { CookieConsentProvider, useCookieConsent } from "@vscookies/react";
function MyBanner() { const { hasConsented, acceptAll, rejectAll } = useCookieConsent(); if (hasConsented) return null; return ( <div> <button onClick={acceptAll}>Accept</button> <button onClick={rejectAll}>Reject</button> </div> );}Web Components (runtime + skin)
Section titled “Web Components (runtime + skin)”<script type="module"> import { defineAll } from "@vscookies/vanilla/define"; import "@vscookies/skin-minimalist-vanilla"; defineAll();</script>
<vscookies-minimalist></vscookies-minimalist>In plain HTML, add an import map mapping the runtime, its define and internal
subpaths, and each skin to their unzipped dist/index.js files — see
Installing from the zip.
Next steps
Section titled “Next steps”- Installing from the zip — the two zips per integration.
- Skins — the available banner skins and their zips.
- Getting Started — pick an integration path.
- Use cases — recipes for gating scripts, category toggles, and more.
- Build your own UI — drive the core directly.