Widgets
The following is the Widget's Custom Style editor. From here, you can:
- 1.Set Custom Style for the Widget.
Property | Accepted values | Behavior |
---|---|---|
color |
| Sets the text's color |
backgroundColor | Any color | Applies solid colors as background on an element. |
background | | sets all background style properties at once, such as color, image, origin and size, or repeat method. Component properties not set in the background shorthand property value declaration are set to their default values. |
borderColor |
| Sets the color of an element's four borders |
borderRadius | Numeric value | Give any element rounded corners |
borderStyle |
| Specifies the type of line drawn around the element |
borderWidth |
| Specifies the thickness of the border. |
header | A JSON containing the following properties along with valid values for each one:
| Specifies the properties of the selected header |
fontSize |
| Specifies the size, or height, of the font |
fontFamily |
| Defines the font that is applied to the selected element |
boxShadow |
| Puts shadows on elements |
fontWeight |
| Sets the weight, or thickness, of a font |
- Any Accepted Values different than numbers, needs to be wrapped up in double quotes as a String.
- Setting any of these properties will override the value inherited from the Dashboard
- Setting any of these properties will render it unable to modify its Custom Style at the Dashboard level
Let's give a metric widget a Custom Style that modifies the following:
- Rounded corners with a border radius of 10
- Outset border style
- A blue-ish background color
- Font color as white
- Border width to 1
The following is the JSON for such Custom Style:
{
"color": "#FFFFFF",
"header": {
"color": "#FFFFFF",
"backgroundColor": "#165a72",
"borderStyle": "dotted"
},
"fontSize": 14,
"borderRadius": 15,
"backgroundColor": "#000000"
}
In order to apply the dotted border to the whole widget, you can change the line
"borderStyle": "dotted"
from the "header" section and put it in the root, however, it is mandatory to the borderWidth property in order for it to be displayed correctly:{
"color": "#FFFFFF",
"header": {
"color": "#FFFFFF",
"backgroundColor": "#165a72"
},
"fontSize": 14,
"borderColor": "white",
"borderStyle": "dotted",
"borderRadius": 15,
"borderWidth": 5,
"backgroundColor": "#000000"
}
This is the Widget with no Custom Style applied yet:

The following is the same Widget after applying the Custom Style above:

Let's modify the Widget's body for the metric widget above. The following properties will be set:
- Black font color
- Font size to 20
- Border radius to 10
- Background color to
#38b01e
- Box shadow to
60px -16px teal
The following is the JSON representing the custom style above:
{
"color": "black",
"header": {
"color": "white",
"borderStyle": "outset",
"borderWidth": 1,
"borderRadius": 10,
"backgroundColor": "#10435b"
},
"fontSize": 20,
"borderRadius": 10,
"backgroundColor": "#38b01e",
"boxShadow": "30px -8px teal"
}
After applying the Custom Style above the Widget will look like:

Let's take again the previous metric Widget for this example.
In this case, instead of setting a flat green background color, a linear gradient will be used.
Set the
background
property to linear-gradient(0.25turn, #3f87a6, #ebf8e1, #f69d3c)
as shown below:
The following is the resulting Widget:

The
background
property can also be used in the Widget's Header as shown below:{
"color": "black",
"header": {
"color": "white",
"borderStyle": "outset",
"borderWidth": 1,
"borderRadius": 10,
"background": "linear-gradient(to left, #333, #333 50%, #eee 75%, #333 75%)"
},
"fontSize": 20,
"borderRadius": 20,
"background": "linear-gradient(0.25turn, #3f87a6, #ebf8e1, #f69d3c)",
"boxShadow": "30px -8px teal"
}

Last modified 1mo ago