Button

Introduction

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

Inline configuration

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

Props Options

Name
Type
Description
display
String
CSS display property. Example: 'flex', 'inline' ...
isDisabled
Boolean
Is the button disabled ?
isShown
Boolean
display/hide the element (default true)
text
Text of the button
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
layout: {...},
5
activeComponents: [
6
{
7
id: "section-button",
8
type: "button",
9
options: {
10
text: {
11
content: "My Button"
12
},
13
style: {
14
default: {
15
color: "white",
16
backgroundColor: "#F07D5A",
17
padding: "10px 20px"
18
}
19
}
20
}
21
}
22
]
23
}
24
};
Copied!
Last modified 9mo ago