Change header's custom style
The following example shows how to dynamically change a widget's header style upon clicking a button by using the HTML Canvas widget.
<button id="color">Click here to change header styling</button>const button = document.querySelector("#color");
button.addEventListener("click", () => {
const event = new CustomEvent("widget_changeHeaderColor", {
detail:{
"backgroundColor": "#00bcd4",
"borderRadius": 7,
"color": "#ffffff",
"boxShadow": "3px 3px 5px 6px #cccccc",
"fontWeight": "bold"
}
});
document.dispatchEvent(event);
});
Last updated
Was this helpful?