This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view : Model -> Html Msg | |
view model = | |
Material.Scheme.topWithScheme Color.Teal Color.LightGreen <| | |
Layout.render Mdl | |
model.mdl | |
[ Layout.fixedHeader | |
, Layout.selectedTab model.selectedTab | |
, Layout.onSelectTab SelectTab | |
] | |
{ header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Counter" ] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view : Model -> Html Msg | |
view model = | |
Material.Scheme.topWithScheme Color.Teal Color.LightGreen <| | |
Layout.render Mdl | |
model.mdl | |
[ Layout.fixedHeader | |
, Layout.selectedTab model.selectedTab | |
, Layout.onSelectTab SelectTab | |
] | |
{ header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Counter" ] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Material.Color as Color | |
view : Model -> Html Msg | |
view model = | |
Material.Scheme.topWithScheme Color.Teal Color.LightGreen <| | |
Layout.render Mdl | |
-- ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view : Model -> Html Msg | |
view model = | |
Material.Scheme.top <| | |
Layout.render Mdl | |
-- ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type alias Model = | |
{ count : Int | |
, mdl : | |
Material.Model | |
-- Boilerplate: model store for any and all Mdl components you use. | |
, selectedTab : Int | |
} | |
model : Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Msg | |
-- ... | |
| SelectTab Int | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
-- ... | |
SelectTab num -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view : Model -> Html Msg | |
view model = | |
Layout.render Mdl | |
model.mdl | |
[ Layout.fixedHeader | |
] | |
{ header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Counter" ] ] | |
, drawer = [] | |
, tabs = ( [ text "Milk", text "Oranges" ], [] ) | |
, main = [ viewBody model ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Material.Layout as Layout | |
view : Model -> Html Msg | |
view model = | |
Layout.render Mdl | |
model.mdl | |
[ Layout.fixedHeader | |
] | |
{ header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Counter" ] ] | |
, drawer = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- This file re-implements the Elm Counter example (1 counter) with elm-mdl | |
buttons. Use this as a starting point for using elm-mdl components in your own | |
app. | |
-} | |
module Main exposing (..) | |
import Html.App as App | |
import Html exposing (..) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir mdl-playground | |
cd mdl-playground | |
elm package install -y debois/elm-mdl | |
vim Main.elm |