Skip to content

Commit

Permalink
Merge pull request #229 from PolymerElements/grid-docs
Browse files Browse the repository at this point in the history
Add docs for grid layout
  • Loading branch information
Emmanuel Garcia committed Apr 19, 2016
2 parents 7799a4e + e224ff1 commit d97b73a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions iron-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
</template>
```
### Grid layout
`iron-list` supports a grid layout in addition to linear layout by setting
the `grid` attribute. In this case, the list template item must have both fixed
width and height (e.g. via CSS), with the desired width of each grid item
specified by the `width` attribute. Based on this, the number of items
per row are determined automatically based on the size of the list viewport.
### Accessibility
`iron-list` automatically manages the focus state for the items. It also provides
Expand Down Expand Up @@ -246,9 +254,16 @@
},

/**
* When true, `iron-list` will render the items in a fixed-width grid.
* The width of each item will be determined from the offsetWidth of
* the provided template DOM
* When true, the list is rendered as a grid. Grid items must have
* fixed width and height set via CSS. e.g.
*
* ```html
* <iron-list grid>
* <template>
* <div style="width: 100px; height: 100px;"> 100x100 </div>
* </template>
* </iron-list>
* ```
*/
grid: {
type: Boolean,
Expand Down

0 comments on commit d97b73a

Please sign in to comment.