Common properties
Common style properties
Some properties are common to every kind of primitives and views. Those properties will be described here but are applicable to all primitives in this section and also on views (screens inherits from view). They are part of a class from which inherits all views and primitives called Positionable
.
Properties
- x
- y
- width
- isAuto_width
- height
- isAuto_height
- layer
x
Type | Default value | Supported value |
---|---|---|
number | 0 | Not applicable |
Describes horizontal position of the element relative to its parent in pixels.
y
Type | Default value | Supported value |
---|---|---|
number | 0 | Not applicable |
Describes vertical position of the element relative to its parent in pixels.
width
Type | Default value | Supported value |
---|---|---|
number | -1 | Not applicable |
Describes the width in pixels of the element.
View width depends on children if isAuto_width
is set to true . View width will equal to its biggest child considering its position + its width
isAuto_width
Type | Default value | Supported value |
---|---|---|
boolean | false | true / false |
Describes that width should be calculated depending on its children width + position. If set to true, you won’t be able to set a width and once set, you can’t modify it.
Note
This property can’t define a behavior for rectangle primitives.
Danger
Auto width is not recommended due to bad performance impact. Linter will raise an error if you use it.
height
Type | Default value | Supported value |
---|---|---|
number | -1 | Not applicable |
Describes the height in pixels of the element.
View height depends on children if isAuto_height
is set to true . View height will equal to its biggest child considering its position + its height
isAuto_height
Type | Default value | Supported value |
---|---|---|
boolean | false | true / false |
Describes that height should be calculated depending on its children height + position. If set to true, you won’t be able to set a height and once set, you can’t modify it.
Note
This property can’t define a behavior for rectangle primitives.
Danger
Auto height is not recommended due to bad performance impact. Linter will raise an error if you use it.
layer
Type | Default value | Supported value |
---|---|---|
number | null | Not applicable |
Describes the layer index which the rectangle belongs to. If not set, layer will be automatically calculated according to the order of declaration of children. As layer is used as relative value to position elements, it could be positive or negative. You can have a look to https://developer.mozilla.org/fr/docs/Web/CSS/CSS_Positioning/Understanding_z_index to better understand layering.