🎉 Home
CUSTOMIZE A TEMPLATE ⏱
LEARN VOLTAPP
https://www.youtube.com/watch?v=i-sbQHixaCA&list=PLd-vdLt174u7Slr7JXR_QhmoyauBQeRNX&index=6
Voltapp's rendering engine is directly based on CSS, it allows you to customize the design of your visual elements with many possibilities.
Most of the "visual" nodes, in other words those that are displayed on the screen, have a Style component. This component allows you to customize the appearance of nodes according to your desires via different attributes (Background, Rounded, etc.).
Here we add to the image a yellow border of 5px thickness
Here we add a black and yellow gradient background to the text
At creation, projects contain a theme variable. This variable is an object, i.e. a set of values corresponding to the colors and fonts used globally in the app. The advantage of using this variable to set colors is that most nodes use it to set their default values.
Here by modifying theme.primaryBackground, all the nodes that use this color are also modified (the checkbox for example)
Apart from the style component, there are other attributes, specific to each node, which allow you to modify their style. For example, you can change the size of a text or the filling mode of an image.
Here you can change the alignment and the way the text is decorated
States allow you to change certain visual attributes of a node based on external changes, for example, on mouse-over or click. Each node can contain different states which themselves allow you to change certain attributes of the node. To change the attributes of a node in a given state, use the buttons at the top of the node:
The button node is switched from one state to another. If a state other than Default is selected, the values of the node's attributes will only be applied in that state.
Here we modify the value of the Color attribute, for the hover state only. As a result, when the button is hovered over, the text color becomes yellow.
Nodes that have multiple states also have a Transition component. This component allows you to define the animation to move from one state to another:
Here the transition between attributes from one state to another lasts 0.3 seconds, there is no delay before the beginning of the transition and finally, the interpolation used is slowed down at the beginning and at the end.