Look and feel
Languages
Our SDK supports multiple languages out-of-the-box with translations for all our standard messages. See below if your website uses other languages. English is the default language: if a visitor does not use a supported language, the banner and popups will be displayed in English.
You do not need to do anything to use Didomi's languages. However, you can choose to enable only certain languages and set up a different default language.
Set the languages.enabled
property to your list of supported languages and languages.default
property as the default language in case the customer language is not supported:
By default, enabled
is the list of supported languages by Didomi and default
is en
. You can support different languages by changing the English texts and setting English as the only enabled language.
We currently support this list of languages.
Language direction
The Didomi SDK adapts to the text direction of your website by default, inheriting the dir
attribute from its parent elements, typically the <html>
or <body>
tag. This ensures compatibility with the overall layout of your site.
To understand more about the HTML dir
attribute please refer to https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
n
By default, the didomi-host
element that contains all notice UI elements is created automatically by the SDK and will inherit the direction from parent elements like <html>
or <body>
tags.
If you need the Didomi notice to have a different text direction from the rest of your website, you can override it by explicitly adding the didomi-host
element and specifying the dir
attribute.
If you cannot directly modify the HTML, you can add the didomi-host
element programmatically via JavaScript:
The example code above should be run before the Didomi SDK is loaded. Overriding the direction of the didomi-host
element will automatically apply the changes to the UI.
Theme
The SDK supports theming by providing a color that will be used across the interfaces (consent notice, popups, etc.) to make sure that our UIs match your brand colors.
The color that you provide should be the main color of your website, the one that appears most frequently.
Position
The notice can be displayed as a popup, a regular banner (top or bottom), a smaller banner or as a floating panel and can be positioned at different locations on the screen.
The position
configuration parameter lets you define the position of the notice. The possible values are:
Examples:
"Disagree and close" button
By default, our notices display Agree and close
and Learn More
buttons. These allow users to give consent or get more information on the purposes and vendors that your website works with.
We also support displaying Agree and close
and Disagree and close
buttons directly in the notice:
To display those buttons, set the notice.denyOptions.button
of your notice to primary
This is supported for both banners (bottom
or top
positions) or pop-ins (popup
position).
Style of the "Disagree and close" button
In the example above the Disagree and close
button is a primary button. To make it a secondary button, you can set the notice.denyOptions.button
configuration option secondary
:
To hide the Disagree and close
button in the notice you can set notice.denyOptions.button
to none
.
Please note that the denyAsPrimary
parameter is deprecated and should not be used for the styling of the "Disagree and close" button.
"Continue without agreeing" link
A "Continue without agreeing" link can be displayed instead of the "Disagree and close" button in the optin
notice type:
To show the "Continue without agreeing" link, set the notice.denyOptions.link
value to true
:
The "Continue without agreeing" link behaves the same way as the "Disagree and close" button.
Please note that if notice.denyOptions.link
is true
then notice.denyOptions.button
options will be ignored and only a link will be shown in the notice.
Please note that the denyAsLink
parameter is deprecated and should not be used for the "Continue without agreeing" link configuration.
Cross button
To comply with Italian regulation, you should add a cross button to the notice. To make the cross button appear in the notice set the notice.denyOptions.cross
parameter value to true
:
Please note that you can have both the “Disagree and close button” and the cross button in the same notice, for example:
Configuring legitimate interest legal basis status
After clicking on the "Disagree and close" button or "Continue without agreeing" link in the optin notice, all purposes' and vendors' consents are disabled, and all purposes' and vendors' legitimate interests are enabled by default.
To disable legitimate interests as well after clicking on the "Disagree and close" button or "Continue without agreeing" link, notice.denyAppliesToLI
should be set to true
in the Didomi configuration object:
Close button
For notices with position popup
, you can show a Close icon to allow users to ignore the notice until the next page:
To show the Close icon, set the notice.canCloseAndIgnore
value to true
:
Text alignment
You can change the alignment of the text inside the notice. The options are left
, right
, center
and justify
. By default, the text is aligned to the left
.
Example:
Logo alignment
You can change the alignment of the logo inside the notice. The options are the one available for the CSS property align-self. So for example to align it to the left, the value would be flex-start
and to the right flex-end
. By default, the logo is aligned to the center
.
Example:
Buttons
Order
You can change the order of the buttons inside the notice. By default learnMorePosition
is null
and the "learn more" button is displayed before the "agree" button on the regular notice and after on the popup notice.
The options are before
and after
.
Example:
Margins
You can set the margins of the "learn more" button on the popup notice.
The options are based on the CSS margin
property.
Example:
Texts
You can change some of the texts of the consent notice:
Example:
Note that you should provide translations for all the languages that your website supports. We provide translations for all our standard messages.
Move the vendors link in your banner to your custom text
If you want to move the vendor link to your custom text notice.content.notice
instead of having a separate link, you can use the function Didomi.preferences.show('vendors')
to open the preference popup. The original link will be automatically replaced.
Last updated