Docs

Cookie Consent

Cookie Consent can help you to comply with privacy laws, such as General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA).
Note
Commercial feature

A commercial Vaadin subscription is required to use Cookie Consent in your project.

Privacy laws such as these require users to be informed and give consent explicitly to the usage of cookies.

<CookieConsent />

By default, a banner is positioned at the top of the screen with predefined text, along with a link to cookiesandyou.com which explains the cookies, and a consent button.

Localization

Cookie Consent is fully customizable. You can customize the message, the "Learn More" link, the "Dismiss" button, and the component’s position. The example below shows text to be displayed to the user in Finnish:

<CookieConsent
  message="Tämä sivusto käyttää evästeitä parhaan kokemuksen tarjoamiseksi"
  dismiss="Selvä"
  learnMore="Lue lisää"
  learnMoreLink="https://vaadin.com/terms-of-service"
/>

Positioning

Cookie Consent can be positioned in the viewport in four non-stretched positions, or stretched across the top or bottom. The tables below list and visually demonstrate these positions:

Top Left

Top Right

Bottom Left

Bottom Right

Top — stretch, default

Bottom — stretch

On smaller viewports, the component always spans the entire width of the viewport.

Theming

Cookie Consent’s theme is modified using CSS.

Important
You can find more information in the corresponding article on vaadin.com.