Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

In a page header

Put the pager in a detail page's header, before the primary action, so the next record is one tap away.

Invoice 12 of 47
Show code
<app-page-header title="INV-2041">
    <app-record-pager index="12" total="47" prev-href="#invoice-2040" next-href="#invoice-2042"
        prev-label="Previous invoice" next-label="Next invoice" keys="true"></app-record-pager>
</app-page-header>

At either end

A direction at an end, or with neither a link nor a handler, is disabled, so the pager never leads nowhere.

The first record
No onPrev here. React's onPrev and onNext are links on Razor (prev-href and next-href).
1 of 47
Show code
<app-record-pager index="1" total="47" next-href="#invoice-2"></app-record-pager>

Every option

Every value of every prop, one cell each.

index: the position, from 1

index not set: empty label, both disabled
index="1": previous disabled
1 of 47
index="47": next disabled
47 of 47

total: how many records

total not set: empty label, both disabled
total="1": one record, both disabled
1 of 1

prev-href: the previous record URL

prev-href="#invoice-2040": previous is a link
12 of 47
prev-href not set: previous disabled
12 of 47

onPrev: a callback, React only

onPrev: a React callback; on Razor the previous link is prev-href
12 of 47

next-href: the next record URL

next-href="#invoice-2042": next is a link
12 of 47
next-href not set: next disabled
12 of 47

onNext: a callback, React only

onNext: a React callback; on Razor the next link is next-href
12 of 47

prev-label: the previous icon's name and tooltip

prev-label="Previous" (default)
12 of 47
prev-label="Previous invoice"
12 of 47

next-label: the next icon's name and tooltip

next-label="Next" (default)
12 of 47
next-label="Next invoice"
12 of 47

keys: J and K press next and previous

keys="false" (default)
12 of 47
keys: J and K step, shown in the tooltips
12 of 47

class: an extra class on the wrapper (React: className)

class="my-pager": a class on the wrapper, for your own styling
12 of 47
ction>

Guidance

What to do, and what to avoid.

Use it when

  • A record opened from a list that people work through.
  • The open item's header in a reading pane.

Reach for something else when

  • Moving between pages of a list. → AppTablePagination

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

10 of 47
React, generated from the controls
<AppRecordPager index={10} total={47} prevHref="?index=9" nextHref="?index=11" />
Razor, the same props
<app-record-pager index="10" total="47" prev-href="?index=9" next-href="?index=11"></app-record-pager>

7 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
indexdefault - int - The position of this record, from 1. Without it (nothing open) the label is empty and both icons are disabled.
totaldefault - int - How many records the list holds.
prev-hrefdefault - string - The previous record URL.
next-hrefdefault - string - The next record URL.
keysdefault false bool false J and K press next and previous.

Less common 2 props

PropTypeDefaultDescription
prev-labeldefault Previous string Previous The previous icon name and tooltip, such as Previous invoice.
next-labeldefault Next string Next The next icon name and tooltip, such as Next invoice.

Screen reader

2 notes
  • The position text is a polite live region, so a change of record is announced.
  • Previous and next are labelled by prevLabel and nextLabel, which also show as their tooltips.