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).
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 which explains the cookies, and a consent button.


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:

  message="Tämä sivusto käyttää evästeitä parhaan kokemuksen tarjoamiseksi"
  learnMore="Lue lisää"


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.


Cookie Consent’s theme is modified using CSS.

You can find more information in the corresponding article on