carboncloud/ui-library/9.1.0

Ui.Pagination

Defines a Pagination component

Types

type Model

The Pagination model

Model

init : Int -> Int -> Result String Model

Creates a model for the component

Returns the current page number

Go to the previous page

nextPage : Model -> Maybe Model

Go to the next page

setPage : Model -> Int -> Maybe Model

Set the current page

getTail : Model -> List Int

Return the right range [current page + 1, number of pages] of the current page

getInitial : Model -> List Int

Return the left range [1,current page - 1] of the current page

Views

-> { siblingCount : Int
, boundaryCount : Int
, onNav : Model -> msg
}
-> Html msg

Returns a view of a pagination component. This should be used whenever possible. You can use customView if you need to customize the button.

List (Attribute Never)
-> Model
-> { siblingCount : Int
, boundaryCount : Int
, onNav : Model -> msg
}
-> Html msg

Returns a custom view of a pagination component. Only use this when view is not enough.