carwow/elm-slider/3.0.0

NOTE: this package is not compatible with Elm 0.19.1

DoubleSlider

A single slider built natively in Elm

Model

type alias Model =
{ min : Float
, max : Float
, step : Int
, lowValue : Float
, highValue : Float
, dragging : Bool
, draggedValueType : SliderValueType
, rangeStartValue : Float
, thumbStartingPosition : Float
, dragStartPosition : Float
, thumbParentWidth : Float
, overlapThreshold : Float
, formatter : Float -> String
}

The base model for the slider

Update

type Msg

The basic type accepted by the update

update : Msg -> Model -> ( Model, Cmd Msg, Bool )

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

subscriptions : Model -> Sub Msg

Returns the subscriptions necessary to run

Configuring the slider

{ min : Float
, max : Float
, step : Int
, lowValue : Float
, highValue : Float
, overlapThreshold : Float
, formatter : Float -> String
}
-> Model

Returns a default range slider

View

view : Model -> Html Msg

Displays the slider

fallbackView : Model -> Html Msg

Displays the slider using two inputs

formatCurrentValue : Model -> String

renders the current values using the formatter