Wrap
This component can be used to display a long list of components, if they get out of the screen the wrap component will make the overflowing ones use a new row.
Examples
Simple wrap
wrap
component works like the flex
component, but instead of trying to fit children in the available space, it will allow you to set fixed width/height and make it display in multiple rows if it overflows the parent.
{
"type": "wrap",
"spacing": 10,
"children": [
{
"type": "text",
"value": "Foo",
},
// This text will be wrapped, this means that it will show itself right under the "Foo" text instead of out of the screen
{
"type": "text",
"value": "Wrapped",
}
]
}
Properties
Attribute | Description | Type |
---|---|---|
_type | The identifier of the component |
|
children | The children of the wrap. | array |
alignment | How the objects in the Wrap should be aligned. | string
|
crossAxisAlignment | How the objects in the Wrap should be aligned on the CrossAxis. | string
|
direction | The direction of the component (horizontal/vertical) | string
|
horizontalDirection | In which direction the elements should be placed following the horizontal axis. | string
|
runAlignment | How the objects in the Wrap should be aligned. | string
|
runSpacing | The spacing between each run of the wrap. | number |
spacing | The spacing between each child of the wrap. | number |
verticalDirection | How the objects should be aligned following the vertical axis. | string
|