Library for showing a cookie consent banner the first time a user visits the application.

By default, the banner is shown attached to the top of the screen and with a predefined text, a link to https://cookiesandyou.com describing cookies and a consent button. The texts, link and position can be configured.

Screenshot of vaadin-cookie-consent

Samples

Add cookie consent banner with default messages

import com.vaadin.flow.component.cookieconsent.CookieConsent;
public class DefaultSettings extends Div {

    public DefaultSettings() {
    	add(new CookieConsent());
    }

}

Add cookie consent banner with customized messages

import com.vaadin.flow.component.cookieconsent.CookieConsent;
public class CustomMessages extends Div {

	public CustomMessages() {
		final String message = "We are using cookies to make your visit here awesome!";
		final String dismissLabel = "Cool!";
		final String learnMoreLabel = "Why?";
		final String learnMoreLink = "https://vaadin.com/terms-of-service";
		final Position position = Position.BOTTOM_RIGHT;
		final CookieConsent consent = new CookieConsent(message, dismissLabel, learnMoreLabel, learnMoreLink, position);
		add(consent);
	}

}

Install

Link to this version
StableReleased 18 February 2019CVAL 3.0
Framework Support
Vaadin platform 12+
Browser Compatibility
11
Install with
Release notes - Version 1.2.1