ceddlyburge / elm-bootstrap-starter-master-view / BootstrapStarter

Creating BootstrapStarter master view type


type alias BootstrapStarter msg =
{ navBar : NavBar msg
, pageTitle : String
, pageContent : PageContent msg 
}

A Master Page Type that represents the Bootstrap Starter Template (https://getbootstrap.com/docs/4.0/examples/starter-template/#)


type alias NavBar msg =
{ title : String
, onClick : msg
, navBarLinks : List (NavBarLink msg)
, search : Search msg 
}

Represents the NavBar


type NavBarLink msg
    = Vanilla (NavBarVanilla msg)
    | DropDown (NavBarDropDown msg)

Represents a NavBarLink


type alias NavBarVanilla msg =
{ title : String
, onClick : msg
, state : LinkState 
}

Represents a vanilla NavBarLink


type LinkState
    = LinkStateVanilla
    | LinkStateSelected
    | LinkStateDisabled

Represents the state of a link


type alias NavBarDropDown msg =
{ title : String
, id : String
, items : List (NavBarDropDownItem msg) 
}

Represents A NavBarLink drop down list


type alias NavBarDropDownItem msg =
{ title : String, onClick : msg }

Represents A NavBarLink drop down list item


type alias Search msg =
{ title : String
, onInput : String -> msg
, onClick : msg 
}

Represents the search form


type PageContent msg
    = Paragraphs (List String)
    | Custom (List (Html.String.Html msg))

Represents the body of a page, can be a list of strings (paragraphs), or a list of custom html