Image

Introduction

Name: didomi-image Component type: image
Display an image.
1
window.didomiConfig = {
2
...
3
components: {
4
layout: {...},
5
activeComponents: [
6
{
7
id: "ID_OF_THE_COMPONENT",
8
type: "image",
9
options: {
10
...,
11
propKey: "PROP_VALUE" // Remember to use camelCase for the key
12
}
13
}
14
]
15
}
16
};
Copied!

Inline configuration

1
<didomi-image container-id="CONTAINER_ID" prop-key="PROP_VALUE" .../>
Copied!

Props Options

Name
Type
Description
alt
String
Alternative attribute of the image
display
String
CSS display property. Example: 'flex', 'inline' ...
src
String
Source of the image.
isShown
Boolean
display/hide the element (default true)
For inline configuration, make sure to use kebab-case syntax. For example fontSize will become font-size.

Examples

Object configuration

1
window.didomiConfig = {
2
...
3
components: {
4
activeComponents: [
5
{
6
id: "section-logo",
7
type: "image",
8
options: {
9
src: "https://www.didomi.io/hubfs/website/general/didomi_logo_dark.svg",
10
style: {
11
default: {
12
width: "100px",
13
margin: "20px"
14
}
15
}
16
}
17
}
18
]
19
}
20
};
Copied!
Last modified 9mo ago