1.7.0 • Public • Published


    GDPR friendly cookie compliance popup to prompt the user for consent, built with ImmutableJS.

    NPM JavaScript Style Guide


    • Yarn: yarn add @uncinc/react-cookie-compliance
    • NPM: npm install --save @uncinc/react-cookie-compliance


    The cookie name being stored is named cookie-compliance-consent.

    import React, { Component } from 'react';
    import { combineReducers } from 'redux-immutable';
    import CookieCompliancePopup, { cookieComplianceReducer } from '@uncinc/react-cookie-compliance';
    // Add the reducer.
    const rootReducer = combineReducers({
      cookieCompliance: cookieComplianceReducer,
    class Example extends Component {
      render () {
        return (
          <CookieCompliancePopup agreeText="Yes" disagreeText="No">
              Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at
              pulvinar quam. Suspendisse pellentesque feugiat sagittis. Donec
              dapibus enim nec consectetur venenatis. Curabitur quis vehicula mi.
              <a href="https://example.com" target="_blank" rel="noopener noreferrer">
                I want to read more!


    1. Go to the ./example directory

    2. Run yarn install

    3. Run yarn start

    Publishing (testing)

    If you want to test locally before publishing you have to use npm pack. Normally you can use yarn link or npm link but since we have a connected component, this does not work because it will use react-redux from dev-dependencies instead of the react-redux from the main app. Besides, using npm pack emulates a package at its best.

    1. In the root run npm pack, this will generate <package-name>-<package-version>.tgz

    2. Go to your main app (where you use this package) and run:

    # Absolute path
    yarn add file:///path/to/my-lib/my-lib-1.0.0.tgz
    # OR
    # Relative path
    yarn add ../../path/to/my-lib/my-lib-1.0.0.tgz

    Publishing to NPM

    Run npm publish.

    Make sure that any npm modules you want as peer dependencies are properly marked as peerDependencies in package.json. The rollup config will automatically recognize them as peers and not try to bundle them in your module.


    Apache License 2.0 © Unc Inc


    npm i @uncinc/react-cookie-compliance

    DownloadsWeekly Downloads






    Unpacked Size

    1.05 MB

    Total Files


    Last publish


    • bernarduncinc
    • martijnhoutman
    • nico-uncinc
    • techwolf12-uncinc
    • q_brouwer
    • rarothedude
    • boazpoolman
    • walteradrichem
    • wbohlken