Customize UI widgets. You can change the colors, the typography, and much more.
To customize the widgets, you need to specify a theme
JSON object. However, this is optional; the UI comes with a default light theme. Create a new Appmixer instance with the theme
option:
Or/and use the option with individual widgets:
If you wish to switch between themes, use the set("theme")
method, this will re-render the UI:
Change the overall styling with a few global CSS properties. Here is a complete example with defaults:
The numbers in the names of colors refer to a foreground opacity of the color over the base background color:
neutral96
is a foreground color with 96% opacity over the background neutral00
.
Some colors need a negative color NG
on top. For example, a white text on a blue button.
The numbers in size of the font refer to the defaults in pixels: size13
variable default is 13px.
Shapes of connectors in diagrams are customizable by choosing a preset in your theme.
Change the values of the entries to switch between presets. Here are built-ins per shape type:
action
action-vertical
action-dark
action-vertical-dark
trigger
trigger-vertical
trigger-dark
trigger-vertical-dark
selection
selection-vertical
selection-dark
selection-vertical-dark
Use Custom Shapes to create new presets or override the defaults.
Charts are customizable by a unique set of non-CSS properties. The values default to the current theme variables, except for colorway
. The colorway
option specifies the dynamic colors automatically picked by charts.
The theme JSON object references the entire Appmixer SDK UI in a complex tree of selectors. Elements use a hash symbol (#
) prefix and dynamic states use the at sign (@
). Each branch in the tree may hold nested selectors and any valid CSS properties for the element. The selectors are available for advanced customizations, but the structure may change between the Appmixer versions.
For reference, we prepared a dark theme for all the Appmixer UI widgets that you can use as a quick overview of all the UI elements that you can set your custom theme for:
Screenshots of the dark theme for some of the UI widgets: