carboncloud/ui-library/2.0.0

NOTE: the latest version is 9.1.0

Ui.Pagination

Defines a Pagination component

Types

An opaque type wrapper around an Int to prevent it from being set outside of the component

type alias Model =
ZipList PageNumber

The Pagination model

Model

{ numberOfPages : Int
, currentPage : PageNumber
}
-> Result String Model

Creates a model for the component

Views

Model
-> { siblingCount : Int
, boundaryCount : Int
, onNav : PageNumber -> 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 : PageNumber -> msg
}
-> Html msg

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

PageNumber

pageNumber : Int -> Int -> Result String PageNumber

Creates a page number given page number that is within the range [1, number of pages]

The intial value of the page number

Unwrap the page number value