Skip to content

Commit a4ff032

Browse files
committed
docs: cleanup WrapLayout
1 parent 122a00a commit a4ff032

File tree

1 file changed

+37
-12
lines changed

1 file changed

+37
-12
lines changed

content/ui/wrap-layout.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
---
22
title: WrapLayout
3+
description: Layout Container that wraps it's items once there's no more space to fit them.
4+
contributors:
5+
- rigor789
6+
- Ombuweb
37
---
48

59
`<WrapLayout>` is a layout container that lets you position items in rows or columns, based on the `orientation` property. When the space is filled, the container automatically wraps items onto a new row or column.
610

7-
## Horizontal WrapLayout
11+
## Examples
12+
13+
### Horizontal WrapLayout
814

915
By default, a `WrapLayout` wraps its child items along a row.
1016
The following example creates a row of equally-sized items. When the row runs out of space, the container wraps the last item to a new row.
@@ -20,7 +26,7 @@ The following example creates a row of equally-sized items. When the row runs ou
2026

2127
<img class="md:w-1/2 lg:w-1/3" src="https://art.nativescript.org/layouts/wrap_layout_horizontal.svg" />
2228

23-
## Vertical WrapLayout
29+
### Vertical WrapLayout
2430

2531
To wrap child items vertically, set the `WrapLayout`'s `orentation` property to `vertical`.
2632
The following example creates a column of equally-sized items. When the column runs out of space, the container wraps the last item to a new column.
@@ -36,17 +42,36 @@ The following example creates a column of equally-sized items. When the column r
3642

3743
<img class="md:w-1/2 lg:w-1/3" src="https://art.nativescript.org/layouts/wrap_layout_vertical.svg" />
3844

39-
## WrapLayout Reference
45+
## Props
46+
47+
### orientation
48+
49+
```ts
50+
orientation: 'horizontal' | 'vertical'
51+
```
52+
53+
Specifies the stacking direction.
54+
55+
Defaults to `horizontal`.
56+
57+
### itemWidth
4058

41-
### Props
59+
```ts
60+
itemWidth: number
61+
```
62+
63+
Sets the width used to measure and layout each child. When not set, the item width is automatically calculated based on it's contents.
64+
65+
Defaults to `Number.NaN`.
66+
67+
### itemHeight
68+
69+
```ts
70+
itemHeight: number
71+
```
4272

43-
| Name | Type | Description |
44-
| -------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45-
| `orientation` | `String` | Specifies the stacking direction.<br/>Valid values: `horizontal` (arranges items in rows) and `vertical` (arranges items in columns).<br/>Default value: `horizontal`. |
46-
| `itemWidth` | `Number` | Sets the width used to measure and layout each child.<br/>Default value: `Number.NaN`, which does not restrict children. |
47-
| `itemHeight` | `Number` | Sets the height used to measure and layout each child.<br/>Default value is `Number.NaN`, which does not restrict children. |
48-
| `...Inherited` | `Inherited` | Additional inherited properties not shown. Refer to the [API Reference](https://docs.nativescript.org/api-reference/classes/wraplayout) |
73+
Sets the height used to measure and layout each child. When not set, the item height is automatically calculated based on it's contents.
4974

50-
### Children props
75+
### ...Inherited
5176

52-
None.
77+
For additional inherited properties not shown, refer to the [API Reference](/api/class/WrapLayout).

0 commit comments

Comments
 (0)