📢 Use this project, contribute to it or open issues to help evolve it using Store Discussion.
A layout capable of ordering components by dragging them on the site editor's interface, and choosing which of them are visible.
⚠️ WARNING: This app is not a page-builder. Always abide to Store-Framework optimization methods to ensure proper performance.
- Add
vtex.disposition-layout
in version3.x
as a theme peer-dependency in themanifest.json
file - Declare your orderable components as children of
disposition-layout
- Add, as prop, an array of objects with the numerical assigment of the given components; always start from
1
- Controlling the visibility is done via site editor, inside each item of the array list
Prop name | Type | Description | Default value |
---|---|---|---|
disposition |
array |
An array of objects describing, with integers, the numerical asigment and order | undefined |
ssr |
boolean |
Set as false if you want this layout to be rendered ONLY in the client-side |
true |
disposition
array:
Prop name | Type | Description |
---|---|---|
order |
number |
The numerical assigment for each children |
show |
boolean |
(Optional) If the children should be rendered |
__editorItemTitle |
string |
(Optional) Item name visible in the Admin Site Editor |
A good implementantion is to declare the array length and numerical values corresponding to the length and order of the children array.
"disposition-layout": {
"children": [
"flex-layout.row#one",
"info-card#example",
"flex-layout.row#two"
],
"props": {
"disposition": [
{
"order": 1
},
{
"order": 2
},
{
"order": 3
}
]
}
},
Per example,
- 1 -> "flex-layout.row#one"
- 2 -> "info-card#example"
- 3 -> "flex-layout.row#two"
If by mistake you delete an item from the list, in site editor, remember that you can go to configuration
and restore the original theme settings.
No CSS Handles are available yet for the app customization.
This project follows the all-contributors specification. Contributions of any kind are welcome!