carboncloud / ui-library / Ui.Pagination

Defines a Pagination component

Types


type Model

The Pagination model

Model

init : Basics.Int -> Basics.Int -> Result String Model

Creates a model for the component

currentPage : Model -> Basics.Int

Returns the current page number

previousPage : Model -> Maybe Model

Go to the previous page

nextPage : Model -> Maybe Model

Go to the next page

setPage : Model -> Basics.Int -> Maybe Model

Set the current page

getTail : Model -> List Basics.Int

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

getInitial : Model -> List Basics.Int

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

Views

view : Model -> { siblingCount : Basics.Int, boundaryCount : Basics.Int, onNav : Model -> msg } -> Accessibility.Styled.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.

customView : List (Html.Styled.Attribute Basics.Never) -> Model -> { siblingCount : Basics.Int, boundaryCount : Basics.Int, onNav : Model -> msg } -> Accessibility.Styled.Html msg

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