Grid

Build awesome Grid layouts in Elm.

This library provides general abstraction for solving grid layout problems.
The idea is to use ordered list of items with dimmensions and number of columns
to solve whole layout of grid. It's designed to be easy to use and extremly deterministic
abstraction with simple integration to any Html, SVG or Canvas based APP.

Definition

type alias Position =
Types.GridPosition

type alias GridPosition =
{ x : Int
, y : Int
}

type alias Size =
Types.GridSize

type alias GridSize =
{ width : Int
, height : Int
}

Api

solve :
(a -> Size)
-> Int
-> List a
-> List ( Position, a )

This function is heart and the only public function
this library provides. It calculates grid layout
for given number of columns and items with dimmensions.
You can then use result (List of tuples with Position and Item)
in you're views to simply render layout as you wish.
Order of items is guaranteed to stay same.