{"repo":"Mastermindzh/react-cookie-consent","free":true,"listed":false,"github":"https://github.com/Mastermindzh/react-cookie-consent","clone":"git clone https://github.com/Mastermindzh/react-cookie-consent.git","description":"A small, simple and customizable cookie consent bar for use in React applications.","language":"TypeScript","stars":638,"topics":["cookies","react","javascript","npm","js"],"license":"MIT","category":"dev-tools","readme_excerpt":":cookie: react-cookie-consent :cookie: A small, simple and customizable cookie consent bar for use in React applications. Demo (storybook): Default look Table of contents - :cookie: react-cookie-consent :cookie: - Default look - Table of contents - Installation - Using it - getting the cookies value in your own code - reset the cookies value in your own code - Props - Debugging it - Why are there two cookies? One of which named \"Legacy\" - Styling it - Examples - Changing the bar background to red - Changing the button font-weight to bold - Using predefined CSS classes - Accept on scroll - Flipping the buttons - Extra cookie options - Rainbows - Overlay - Contributor information - Projects using react-cookie-consent Installation or use yarn: Using it You can import the cookie bar like this: If you want to set/remove cookies yourself you can optionally import Cookies (straight from js-cookie) like this: Then you can use the component anywhere in your React app like so: You can optionally set some props like this (next chapter will show all props): One of the props (onAccept) is a function, this function will be called after the user has clicked the accept button. It is called with an object containing a boolean property acceptedByScrolling to indicate if the acceptance was triggered by the user scrolling You can provide a function like so: If the decline button is enabled then the (onDecline) prop function can be used, this function will be called after the user has clicked the","default_branch":null,"files":null,"tree":[],"storefront":"/r/Mastermindzh","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Mastermindzh/react-cookie-consent/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}