git.iko.soy/typeable/elm-ui
on cd088cb help sign in
65 lines 1.5 kB history raw
1module Main exposing (..)
3{-| -}
5import Element exposing (..)
6import Element.Background as Background
7import Element.Font as Font
8import Element.Input
9import Element.Lazy
12type alias Person =
13 { firstName : String
14 , lastName : String
15 }
18persons : List Person
19persons =
20 [ { firstName = "David"
21 , lastName = "Bowie"
22 }
23 , { firstName = "Florence"
24 , lastName = "Welch"
25 }
26 ]
29main =
30 Element.layout
31 [ Background.color (rgba 0 0 0 1)
32 , Font.color (rgba 1 1 1 1)
33 , Font.italic
34 , Font.size 32
35 , Font.family
36 [ Font.external
37 { url = "https://fonts.googleapis.com/css?family=EB+Garamond"
38 , name = "EB Garamond"
39 }
40 , Font.sansSerif
41 ]
42 ]
43 <|
44 Element.table
45 [ Element.centerX
46 , Element.centerY
47 , Element.spacing 5
48 , Element.padding 10
49 ]
50 { data = persons
51 , columns =
52 [ { header = Element.text "First Name"
53 , width = px 200
54 , view =
55 \person ->
56 Element.text person.firstName
57 }
58 , { header = Element.text "Last Name"
59 , width = fill
60 , view =
61 \person ->
62 Element.text person.lastName
63 }
64 ]
65 }