{"id":19407663,"url":"https://github.com/sletheren/react-gdpr-consent","last_synced_at":"2025-04-24T09:31:44.581Z","repository":{"id":33659851,"uuid":"157004328","full_name":"Sletheren/react-gdpr-consent","owner":"Sletheren","description":"A simple component for your react app to implement the General Data Protection Regulation (GDPR) in a friendly-UI approach using toggles","archived":false,"fork":false,"pushed_at":"2022-12-10T16:34:05.000Z","size":1964,"stargazers_count":9,"open_issues_count":21,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T03:06:00.531Z","etag":null,"topics":["gdpr","gdpr-component","react","react-components","toggles"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sletheren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-10T17:25:44.000Z","updated_at":"2022-12-10T18:55:56.000Z","dependencies_parsed_at":"2023-01-15T02:00:41.823Z","dependency_job_id":null,"html_url":"https://github.com/Sletheren/react-gdpr-consent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sletheren%2Freact-gdpr-consent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sletheren%2Freact-gdpr-consent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sletheren%2Freact-gdpr-consent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sletheren%2Freact-gdpr-consent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sletheren","download_url":"https://codeload.github.com/Sletheren/react-gdpr-consent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250600715,"owners_count":21457017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gdpr","gdpr-component","react","react-components","toggles"],"created_at":"2024-11-10T12:03:25.788Z","updated_at":"2025-04-24T09:31:44.242Z","avatar_url":"https://github.com/Sletheren.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REACT-GDPR-CONSENT [![Version](https://img.shields.io/npm/v/react-gdpr-consent.svg)](https://www.npmjs.com/package/react-gdpr-consent)\n\nA React component to make it easy to implement the General Data Protection Regulation (GDPR) into your React App\n## Online Demo\n\n![Screenshots](https://raw.githubusercontent.com/Sletheren/react-gdpr-consent/master/examples/src/example.gif)\n\nYou can check out this little demo to get the feel of it: [Online demo](https://sletheren.github.io/react-gdpr-consent/)\n\n## Get started\n\nIt's very easy to use the tool, follow the instructions\n\n### Add the package\n\nInstall the package using npm\n\n```\nnpm i react-gdpr-consent \n```\n\n### Import the package into your react app\n\n```\nimport GDPR from 'react-gdpr-consent'\n```\n\n### Pass a configuration array as a prop `config` to the GDPR component\nExample of the Configuraiton array:\n````js\nconst config = [\n      { id: 'age', text: \"I'm 18 years old or older\", checked: true, locked: true },\n      { id: 'terms', text: \"I accept\", checked: true, locked: true, link: \"http://www.example.com/terms.html\", linkText: \"terms \u0026 conditions\"},\n      { id: 'privacy', text: \"I accept\", checked: true, locked: true, link: \"http://www.example.com/privacy.html\", linkText: \"Privacy \u0026 policy\" },\n      { id: 'newsletter', text: \"I want to receive newsletters and updates by email\", checked: false, locked: false }\n]\n````\n\nThen pass it to the GDPR component:\n```\n\u003cGDPR config={config} toggleHandler={toggleHandler} linkHanlder={linkHanlder}/\u003e\n```\n\nExplanation of the different properties of the configuration array:\n\n| Name         | Type | Description |\n| ------------ | ----------- | ----------- |\n| id | String | Unique string that defines the element |\n| text | String | The text that's showed before the toggle |\n| checked | Boolean | If the toggle is checked initially (default: false) |\n| locked | Boolean | If the toggle is disabled or not (default: false) |\n| link | string (OPTIONAL) | If specified the text can be clicked as a link |\n| linkText | string (OPTIONAL) | the text that will be clicked |\n\n\n### Pass `ToggleHanlder` and `linkHandler`:\n\nThe two functions are mendatory to handle the toggle of the items and the link action handling\n\nExample:\n````js\nconst linkHanlder = (link) =\u003e {\n  window.open(link, '_blank');\n}\nconst toggleHandler = (id, value) =\u003e {\n  console.log(id, value)\n}\nreturn (\n    \u003cGDPR config={config} toggleHandler={toggleHandler} linkHanlder={linkHanlder}/\u003e\n);\n````\n\n\n\n| Name         | Type | Description |\n| ------------ | ----------- | ----------- |\n| toggleHandler | function | Function that is fired when an item is toggeled, it has 2 params (id, value) |\n| linkHandler | function | Function that handles when the user clicks on a link it has 1 param (link) |\n\n\n### Enjoy :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsletheren%2Freact-gdpr-consent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsletheren%2Freact-gdpr-consent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsletheren%2Freact-gdpr-consent/lists"}