A minimal web player written in Elm, just for fun. The goals was a minimal web-app that can be hosted on my Minio (s3) next to the video content.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
628 B

module Dropdown exposing (..)
import Html
import Html.Attributes
import Html.Events as Events
type alias Option =
{ value : String
, display : String
}
type alias Config msg =
{ options : List Option
, default : Option
, selectEvent : String -> msg
}
view : Config msg -> Html.Html msg
view config = Html.select [ Events.onInput config.selectEvent ] <|
makeOption config.default
:: List.map makeOption config.options
makeOption : Option -> Html.Html msg
makeOption option =
Html.option
[ Html.Attributes.value option.value ]
[ Html.text option.display ]