Socket
Socket
Sign inDemoInstall

@fremtind/jkl-cookie-consent-react

Package Overview
Dependencies
24
Maintainers
2
Versions
187
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fremtind/jkl-cookie-consent-react

Jøkul react cookie consent component


Version published
Maintainers
2
Created

Readme

Source

Beskrivelse

Se portalen for bruk og prinsipper.

Kom i gang

Lær hvordan du kan ta i bruk Jøkul

Bruk av React-pakken

Installasjon

  1. Installér pakken med yarn add @fremtind/jkl-cookie-consent-react eller npm i @fremtind/jkl-cookie-consent-react. Stil-pakken blir automatisk installert som en avhengighet.

  2. Importer både React-pakken (velg komponenten(e) du trenger) og stil-pakken i prosjektet ditt:

import { CookieConsentProvider, CookieConsent, useCookieConsent } from "@fremtind/jkl-cookie-consent-react";
import "@fremtind/jkl-cookie-consent/cookie-consent.min.css";
import "@fremtind/jkl-button/button.min.css";
import "@fremtind/jkl-list/list.min.css";

Bruk

Komponentene tar følgende props:

CookieConsentProvider:

  • marketing: Krav om cookies for markedsføring
  • functional: Krav om funksjonelle cookies
  • statistics: Krav om cookies for statistikk
  • cookieAdapter: En funksjon som gjør oppslag mot cookies, for å lete etter andre cookies som kan bestemme et consent

CookieConsent:

  • blocking: Betegner en blokkerende modal, som krever en aktiv handling
  • onAccept: Callback når et consent er håndtert. Første argument er consentet.

Enkel bruk kan se sånn ut:

<CookieConsentProvider functional marketing statistics>
    <Content />
    <CookieConsent blocking />
</CookieConsentProvider>

Keywords

FAQs

Last updated on 29 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc