CookiesConsent
This component can be one good UI solution for you when you want to handle yourself the interface between your cookies and your users. CookiesConsent provides a light but advanced interface to help you manage your cookies selections.
On desktop screens, the description of the category will be displayed next to the title. On small screens, it will be displayed inside the content of the accordion.
You can append any content to each <CookiesConsent.Category>
, meaning you can bring
your own table component, or a list, or even a simple paragraph. Here, the Table
component
is not included in <CookiesConsent>
, it is a separate component for the sake of the demo.
Note: By default, the Categories are uncontrolled. But you can also chose to control them with a [checked, onChange] set of props.
Default
Manage Cookies Preferences
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Functional cookies
Theses cookies enable us to offer you a personalized experience on our site
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Tracking cookies
Theses cookies helps us to track you. You cannot escape!
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Table in categories
Manage Cookies Preferences
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
Functional cookies
Theses cookies enable us to offer you a personalized experience on our site
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
Tracking cookies
Theses cookies helps us to track you. You cannot escape!
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
No controls
Manage Cookies Preferences
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Functional cookies
Theses cookies enable us to offer you a personalized experience on our site
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Tracking cookies
Theses cookies helps us to track you. You cannot escape!
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
No title
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Functional cookies
Theses cookies enable us to offer you a personalized experience on our site
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Tracking cookies
Theses cookies helps us to track you. You cannot escape!
This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies. This is a paragraph explaining how great are those cookies.
Extended
This component was extended using styled() from styled-components.
Manage Cookies Preferences
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
Functional cookies
Theses cookies enable us to offer you a personalized experience on our site
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
Tracking cookies
Theses cookies helps us to track you. You cannot escape!
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
Props
Name | Type | Default | Description |
---|---|---|---|
children | node | The content of the component. You can either use an assemble of the ones available in its scope, like CookiesConsent.Category, or bring your own elemnts. | |
title | string | The main title of the component. |
The ref
will be forwarded to the html root element, as well as any other props.
CookiesConsent.Category
Default Category
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
This is a paragprah about the category. This is a paragprah about the category. This is a paragprah about the category.
This is a paragprah about the category. This is a paragprah about the category. This is a paragprah about the category.
Table in content
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
Name | Value | Expires | Description |
---|---|---|---|
name | john Smith | in 5 days | Your name. |
age | 42 | on the 3th of November 2020 | Your age. |
sex | M | 12/12/20 | Your sex. |
plan | premium | in 21 days | The plan you first chose on sign up. |
No description
Analytics cookies
This is a paragprah about the category. This is a paragprah about the category. This is a paragprah about the category.
Extended
This component was extended using styled() from styled-components.
Analytics cookies
Theses cookies help us to analyze what you are doing on our site
This is a paragprah about the category. This is a paragprah about the category. This is a paragprah about the category.
Props
This component extends Material's UI <Accordion>
so you can use all its props as well. Check out its Api.
Name | Type | Default | Description |
---|---|---|---|
checked | bool | If true, the switch is checked and the category is on. Leave to undefined if you don't need to control the component. | |
children | node | The content of the category. | |
description | string | A brief description of the cookies category. | |
onChange | func | Function called on switch change. Signature: (event) => void. You can access the value using `event.target.value`. | |
title* | string | The title of the cookies category. Required. |
The ref
will be forwarded to the html root element, as well as any other props.
CookiesConsent.Controls
Default Controls
No switch
Custom controls
Extended
This component was extended using styled() from styled-components.
Props
Name | Type | Default | Description |
---|---|---|---|
checked | bool | If true, the switch is checked and the category is on. Leave to undefined if you don't need to control the component. | |
children | node | The content of the controls section. You can either use CookiesConsent.Button or bring your own controls. | |
onChange | func | Function called on switch change. Signature: (event) => void. You can access the value using `event.target.checked`. If you don't provide an onChange function, the switch will not be displayed. | |
switchLabel | string | The switch's label. |
The ref
will be forwarded to the html root element, as well as any other props.
CookiesConsent.Button
Default Button
Props
This component extends Material's UI <Button>
so you can use all its props as well. Check out its Api.
It requires no other prop.
The ref
will be forwarded to the html root element, as well as any other props.