Nexo-Tec / cookieconsent

:cookie:‏‏‎ ‎‏‏‎ ‎Port of Simple cross-browser cookie-consent plugin written in vanilla js to React component
MIT License
2 stars 0 forks source link

Map props #12

Open ibrahimcesar opened 3 years ago

ibrahimcesar commented 3 years ago

All available options on original lib

Below a table which sums up all of the available options (must be passed to the .run() method). Option Type Default Description
autorun boolean true If enabled, show the cookie consent as soon as possible (otherwise you need to manually call the .show() method)
delay number 0 Number of milliseconds before showing the consent-modal
cookie_expiration number 182 Number of days before the cookie expires (182 days = 6 months)
cookie_path string "/" Path where the cookie will be set
cookie_domain string location.hostname Specify your domain (will be grabbed by default) or a subdomain
cookie_same_site string "Lax" SameSite attribute
theme_css string - Specify path to the .css file
force_consent boolean false Enable if you want to block page navigation until user action (check faq for a proper implementation)
current_lang string - Specify one of the languages you have defined (can also be dynamic): 'en', 'de' ...
auto_language boolean false Automatically grab the language based on the user's browser language, if language is not defined => use specified current_lang
autoclear_cookies boolean false Enable if you want to automatically delete cookies when user opts-out of a specific category inside cookie settings
page_scripts boolean false Enable if you want to easily manage existing <script> tags. Check manage third party scripts
remove_cookie_tables boolean false Enable if you want remove the html cookie tables (and still want to make use of autoclear_cookies)
gui_options object - Customization option which allows to choose layout, position and transition. Check layout options & customization
onAccept function - Method run once either when:
1. The moment the cookie consent is accepted
2. After each page load (if cookie consent has alredy been accepted)
onChange function - Method run whenever preferences are modified (and only if cookie consent has alredy been accepted)
languages object - Check below for configuration

How much of this needs to be ported?