{ rootClassName : String
, id : String
, transitionSpeedWhenAdvancing : TransitionSpeed
, enableDrag : Basics.Bool
, swipeOffset : Basics.Int
}
The configuration options of a Gallery. These can be passed in while initializing a new Gallery.
defaultConfig : Config
A convenience function that returns some default configuration options.
A number of milliseconds to spend transitioning between indices.
init : { width : String, height : String } -> Config -> List (Html Msg) -> Gallery
Create a new Gallery, with given size, config and slides
update : Msg -> Gallery -> ( Gallery, Platform.Cmd.Cmd Msg )
Update the gallery with given Msg. You would need to wrap and unwrap these Msg's inside your own update function.
Example:
type Msg
= MsgForGallery Gallery.Msg
update : Msg -> Model -> Model
update msg model =
case msg of
MsgForGallery msg ->
{ model | gallery = Gallery.update msg model.gallery }
view : Gallery -> Html Msg
Render your gallery e.g.
Example:
type Msg
= MsgForGallery Gallery.Msg
view : Model -> Html Msg
view model =
Html.div []
[ Gallery.view model.gallery
|> Html.map MsgForGallery
]
previous : Gallery -> ( Gallery, Platform.Cmd.Cmd Msg )
Go to the previous slide
next : Gallery -> ( Gallery, Platform.Cmd.Cmd Msg )
Go to the next slide
goTo : Basics.Int -> Gallery -> ( Gallery, Platform.Cmd.Cmd Msg )
Go to a specific slide, animated
setIndex : Basics.Int -> Gallery -> ( Gallery, Platform.Cmd.Cmd Msg )
Go to a specific slide, direclty
getCurrentIndex : Gallery -> Basics.Int
Retrieve the current displayed Slide index
The model of a Gallery You can create a new Gallery using the init function.
The Gallery's internal Msg's