# Grid layout in elm-ui

**URL:** <https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100>\
**Category:** Learn\
**Created:** [January 28, 2020, 11:22pm UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100 "2020-01-28T23:22:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GaiusScotius](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@GaiusScotius](https://discourse.elm-lang.org/u/GaiusScotius)\
**Post date:** [January 28, 2020, 11:22pm UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100/1 "2020-01-28T23:22:33Z")

</div>

Hi,

I’ve been working through the “Photo Groove” example from “Elm in Action”. Not knowing anything much at all about html, I found that part very unintuitive so decided to try rewriting the user interface using elm-ui instead of Html. Overall it seems much easier for a beginner with no web development background to understand. However…

The Photo Groove user interface includes a section displaying thumbnail pictures. In the book it is created as follows:

…  
, div  
[id “thumbnails”, class (sizeToString model.chosenSize)]  
(List.map (viewThumbnail model.selectedUrl) model.photos)

_stringToSize_ converts an enumerated value (a type Small, Medium, Large) to a string, which is the “class” (whatever that means) of the

. There is some chicanery in a css file that tells the browser what size image to display based on the “class” string.

_viewThumbnail_ creates a ![]() for each photo (and does some other stuff with “selectedUrl” that is not relevant to this question). The result is a

 node that contains an arbitrary number of ![]() nodes, which end up being displayed as a grid (at least it looks like that, it may just be a line of them that get wrapped when it gets too wide).

Can anyone point me to an elm-Ui Element that is equivalent to that

? It doesn’t seem to me to be a row or a column; table wants two lists; and I can’t find any other container that will take a list of images.

Other than that I have to say Elm is much easier than I’d expected, at least at the super novice level; I still carry serious brain damage from early conflict with C pointers in the 1980’s!

Thanks

---

<div class="post-metadata">

**Author:** ![mthiems](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/mthiems/32/2040_2.png) [@mthiems](https://discourse.elm-lang.org/u/mthiems)\
**Post date:** [January 29, 2020, 1:12am UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100/2 "2020-01-29T01:12:51Z")

</div>

I’m not sure I know exactly what you’re looking for based on just your description, but have you looked at wrappedRow ?  
[https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/Element#wrappedRow](https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/Element#wrappedRow)

---

<div class="post-metadata">

**Author:** ![GaiusScotius](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@GaiusScotius](https://discourse.elm-lang.org/u/GaiusScotius)\
**Post date:** [January 29, 2020, 7:17am UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100/3 "2020-01-29T07:17:43Z")

</div>

Sorry about not being clearer, I think the tag names disappeared from my post because I out then inside gt / lt signs and didn’t realise they needed special treatment.

Anyway, I shall try wrappedRow forthwith. …

Thanks

---

<div class="post-metadata">

**Author:** ![perty](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/perty/32/4459_2.png) [@perty](https://discourse.elm-lang.org/u/perty)\
**Post date:** [January 31, 2020, 6:09am UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100/4 "2020-01-31T06:09:44Z")

</div>

I use wrapped row a lot. Makes things fit into small screens .

---

<div class="post-metadata">

**Author:** ![GaiusScotius](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@GaiusScotius](https://discourse.elm-lang.org/u/GaiusScotius)\
**Post date:** [February 2, 2020, 6:08pm UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100/5 "2020-02-02T18:08:27Z")

</div>

worked a treat, thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [February 12, 2020, 6:08pm UTC](https://discourse.elm-lang.org/t/grid-layout-in-elm-ui/5100/6 "2020-02-12T18:08:32Z")

</div>

Closed on February 12, 2020, 6:08pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
