bemyak / elm-slider / DoubleSlider

A single slider built natively in Elm

Model


type alias Model =
{ min : Basics.Float
, max : Basics.Float
, step : Basics.Int
, lowValue : Basics.Float
, highValue : Basics.Float
, dragging : Basics.Bool
, draggedValueType : SliderValueType
, rangeStartValue : Basics.Float
, thumbStartingPosition : Basics.Float
, dragStartPosition : Basics.Float
, thumbParentWidth : Basics.Float
, overlapThreshold : Basics.Float
, minFormatter : Basics.Float -> String
, maxFormatter : Basics.Float -> String
, currentRangeFormatter : Basics.Float -> Basics.Float -> Basics.Float -> Basics.Float -> String
, ratio : Basics.Float 
}

The base model for the slider

defaultModel : Model

Returns a default range slider

Update


type Msg

The basic type accepted by the update

update : Msg -> Model -> ( Model, Platform.Cmd.Cmd Msg, Basics.Bool )

takes a model and a message and applies it to create an updated model

subscriptions : Model -> Platform.Sub.Sub Msg

Returns the subscriptions necessary to run

View

view : Model -> Html Msg

Displays the slider

fallbackView : Model -> Html Msg

Displays the slider using two inputs

formatCurrentRange : Model -> String

Renders the current values using the formatter