Liking cljdoc? Tell your friends :D

charm.components.paginator

Pagination component for displaying page indicators.

Usage: (def pager (paginator :total-pages 5))

;; In update function: (paginator-update pager msg)

;; In view function: (paginator-view pager)

Pagination component for displaying page indicators.

Usage:
  (def pager (paginator :total-pages 5))

  ;; In update function:
  (paginator-update pager msg)

  ;; In view function:
  (paginator-view pager)
raw docstring

go-to-firstclj

(go-to-first pager)

Go to first page.

Go to first page.
sourceraw docstring

go-to-lastclj

(go-to-last pager)

Go to last page.

Go to last page.
sourceraw docstring

items-on-pageclj

(items-on-page pager total-items)

Get number of items on current page.

Get number of items on current page.
sourceraw docstring

next-pageclj

(next-page pager)

Go to next page.

Go to next page.
sourceraw docstring

on-first-page?clj

(on-first-page? pager)

Check if on first page.

Check if on first page.
sourceraw docstring

on-last-page?clj

(on-last-page? pager)

Check if on last page.

Check if on last page.
sourceraw docstring

pageclj

(page pager)

Get current page (0-indexed).

Get current page (0-indexed).
sourceraw docstring

paginatorclj

(paginator &
           {:keys [total-pages per-page page type active-dot inactive-dot
                   arabic-format active-style inactive-style id]
            :or {total-pages 1
                 per-page 1
                 page 0
                 type :dots
                 active-dot "•"
                 inactive-dot "○"
                 arabic-format "%d/%d"
                 id (rand-int 1000000)}})

Create a paginator component.

Options: :total-pages - Total number of pages (default 1) :per-page - Items per page (default 1) :page - Current page, 0-indexed (default 0) :type - :dots or :arabic (default :dots) :active-dot - String for active page dot (default "•") :inactive-dot - String for inactive page dot (default "○") :arabic-format - Format string for arabic type (default "%d/%d") :active-style - Style for active indicator :inactive-style - Style for inactive indicator :id - Unique ID

Create a paginator component.

Options:
  :total-pages   - Total number of pages (default 1)
  :per-page      - Items per page (default 1)
  :page          - Current page, 0-indexed (default 0)
  :type          - :dots or :arabic (default :dots)
  :active-dot    - String for active page dot (default "•")
  :inactive-dot  - String for inactive page dot (default "○")
  :arabic-format - Format string for arabic type (default "%d/%d")
  :active-style  - Style for active indicator
  :inactive-style - Style for inactive indicator
  :id            - Unique ID
sourceraw docstring

paginator-initclj

(paginator-init pager)

Initialize the paginator, returns [pager cmd].

Initialize the paginator, returns [pager cmd].
sourceraw docstring

paginator-updateclj

(paginator-update pager msg)

Update paginator state based on a message. Returns [new-pager cmd] or [pager nil] if message not handled.

Update paginator state based on a message.
Returns [new-pager cmd] or [pager nil] if message not handled.
sourceraw docstring

paginator-viewclj

(paginator-view pager)

Render the paginator to a string.

Render the paginator to a string.
sourceraw docstring

per-pageclj

(per-page pager)

Get items per page.

Get items per page.
sourceraw docstring

prev-pageclj

(prev-page pager)

Go to previous page.

Go to previous page.
sourceraw docstring

set-pageclj

(set-page pager p)

Set current page.

Set current page.
sourceraw docstring

set-per-pageclj

(set-per-page pager n)

Set items per page.

Set items per page.
sourceraw docstring

set-total-itemsclj

(set-total-items pager total-items)

Set total pages based on item count.

Set total pages based on item count.
sourceraw docstring

set-total-pagesclj

(set-total-pages pager n)

Set total pages.

Set total pages.
sourceraw docstring

slice-boundsclj

(slice-bounds pager total-items)

Get [start end] bounds for slicing items for current page.

Get [start end] bounds for slicing items for current page.
sourceraw docstring

total-pagesclj

(total-pages pager)

Get total number of pages.

Get total number of pages.
sourceraw docstring

type-arabicclj

source

type-dotsclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close