module@warp-drive/experiments/pagination @experimental
Interface RelationalPaginationLink sincev5.9.0
ts
interface RelationalPaginationLink {
readonly isCurrent: boolean;
readonly isReal: true;
readonly rel: "first" | "prev" | "next" | "last";
setActive: () => Promise<unknown>;
readonly url: string;
get text(): string;
}Hideconstructor
A relational (first/prev/next/last) navigation link, relative to the active page. Unlike RealPaginationLink these carry no ordinal index — they are the only links available for cursor-based pagination, where pages are chained purely by opaque relational links with no page number or total. They are also available in numbered pagination as a convenience.
gts
<EachLink @pages={{pages}} as |state|>
{{#if state.prev}}<button {{on "click" state.prev.setActive}}>Previous</button>{{/if}}
{{#if state.next}}<button {{on "click" state.next.setActive}}>Next</button>{{/if}}
</EachLink>Properties
isCurrent
ts
readonly isCurrent: boolean;Whether this link points at the page that is already active — for example the first link while the first page is being viewed. Useful for disabling the control.
isReal
ts
readonly isReal: true;rel
ts
readonly rel: "first" | "prev" | "next" | "last";setActive
ts
setActive: () => Promise<unknown>;Loads this link's page and makes it the active page on the associated PaginationState. It is a stable reference, so it is safe to pass around as an "action" or "event" handler:
gts
<button {{on "click" link.setActive}}>{{link.text}}</button>Returns
Promise<unknown>
url
ts
readonly url: string;text
Get Signature
ts
get text(): string;Returns
string