Skip to content
Devix Open Source

Playground

Turn the options and watch it change. The code below changes with it, in whichever framework you are using — copy it and you have what is on the screen.

Live
import { createCookieConsent } from '@devix-labs/cookie-consent';
import '@devix-labs/cookie-consent/styles.css';

createCookieConsent({
  categories: [
    {
      id: 'necessary',
      label: 'Strictly necessary',
      required: true,
      description: 'Signing in, your basket, and the choice you make here.'
    },
    {
      id: 'analytics',
      label: 'Analytics',
      description: 'How the site is used, so we know what to fix.',
      services: [{"id":"ga4","label":"Google Analytics 4"}]
    },
    {
      id: 'marketing',
      label: 'Marketing',
      description: 'Adverts that follow you to other sites.',
      services: [{"id":"meta","label":"Meta Pixel"}]
    }
  ],
  layout: 'box',
  position: 'bottom-left',
  modal: false,
  consentMode: true,
  policyUrl: 'https://example.com/privacy',
  headingTag: 'h2'
});

Every option here is in the documentation, along with the ones that are not worth a control.