Inline Pagination

Description

The compact "‹ 3 of 7 ›" control

InlinePagination is a chevron either side of where you are in a set, inside one rounded pill. Use it for stepping through things one at a time (the result open in a preview, the photo in a lightbox, the record in an editor) beside other commands in a toolbar or a header, where Pagination's row of numbered page buttons would be too much.

Each chevron is enabled by having a handler: OnPrevious and OnNext. Leaving one out greys its chevron, which is how the first and the last of a set say so. The position and count only write the label, so a set that loads more as it goes stays in charge of when there is a next.

SetLabel replaces the counted label with text of your own ("Page 3", "March", the name of the thing you are on), and SetFormat changes how the position and count are written, for another language or for "3 / 7". SetTooltips names each chevron for a screen reader.

Samples

Stepping through a set

A custom label and format

API reference

class

InlinePagination

public sealed class InlinePagination : ComponentBase<InlinePagination, HTMLElement>

The compact "‹ 3 of 7 ›" control: a chevron either side of where you are in a set, inside one rounded pill. It is for stepping through things one at a time - the result open in a preview, the photo in a lightbox, the record in an editor - beside other commands in a toolbar or a header, where Pagination's row of numbered page buttons would be far too much. Each chevron is enabled by having a handler: OnPrevious and OnNext. Leaving one out greys its chevron, which is how the first and the last of a set say so - the position and count only write the label, so a set that loads more as it goes stays in charge of when there is a next.

Namespace
Tesserae
Inheritance
ComponentBase<InlinePagination, HTMLElement> → InlinePagination

Constructors

NameDescription
InlinePaginationInitializes a new instance of this class showing the given position in the given count, both 1-based. A count of zero leaves the label out and the control is the two chevrons alone.
Constructor
InlinePagination
public InlinePagination(int position = 0, int count = 0)

Initializes a new instance of this class showing the given position in the given count, both 1-based. A count of zero leaves the label out and the control is the two chevrons alone.

Properties

NameDescription
PositionGets or sets where in the set the control says you are, 1-based.
CountGets or sets how many there are in the set. Zero leaves the label out.
CanGoPreviousReturns a value indicating whether the previous chevron is enabled.
CanGoNextReturns a value indicating whether the next chevron is enabled.
Property
InlinePagination.Position
public int Position { get ; set ; }

Gets or sets where in the set the control says you are, 1-based.

Property
InlinePagination.Count
public int Count { get ; set ; }

Gets or sets how many there are in the set. Zero leaves the label out.

Property
InlinePagination.CanGoPrevious
public bool CanGoPrevious

Returns a value indicating whether the previous chevron is enabled.

Property
InlinePagination.CanGoNext
public bool CanGoNext

Returns a value indicating whether the next chevron is enabled.

Methods

NameDescription
RenderRenders the component's root HTML element.
SetPositionSets where in the set the control says you are, and how many there are - both 1-based. A count of zero (or a position past it) leaves the label out, so a set whose size isn't known yet shows the chevrons alone rather than a label that would have to lie.
SetLabelPuts the given text between the chevrons in place of the position and count - "Page 3", "March", the name of the thing you are on. Pass null to go back to the counted label.
SetFormatChanges how the position and the count are written - for another language, or for "3 / 7".
OnPreviousRegisters what the previous chevron does, and enables it. Pass null to grey it out - which is how the first of a set says it is the first.
OnNextRegisters what the next chevron does, and enables it. Pass null to grey it out.
SetTooltipsSets what each chevron is called for a screen reader and in its tooltip - "Previous result" and "Next result" rather than the bare "Previous" and "Next" they carry by default.
Method
InlinePagination.Render
public override HTMLElement Render()

Renders the component's root HTML element.

Method
InlinePagination.SetPosition
public InlinePagination SetPosition(int position, int count)

Sets where in the set the control says you are, and how many there are - both 1-based. A count of zero (or a position past it) leaves the label out, so a set whose size isn't known yet shows the chevrons alone rather than a label that would have to lie.

Method
InlinePagination.SetLabel
public InlinePagination SetLabel(string text)

Puts the given text between the chevrons in place of the position and count - "Page 3", "March", the name of the thing you are on. Pass null to go back to the counted label.

Method
InlinePagination.SetFormat
public InlinePagination SetFormat(Func<int, int, string> format)

Changes how the position and the count are written - for another language, or for "3 / 7".

Method
InlinePagination.OnPrevious
public InlinePagination OnPrevious(Action<InlinePagination> onPrevious)

Registers what the previous chevron does, and enables it. Pass null to grey it out - which is how the first of a set says it is the first.

Method
InlinePagination.OnNext
public InlinePagination OnNext(Action<InlinePagination> onNext)

Registers what the next chevron does, and enables it. Pass null to grey it out.

Method
InlinePagination.SetTooltips
public InlinePagination SetTooltips(string previous, string next)

Sets what each chevron is called for a screen reader and in its tooltip - "Previous result" and "Next result" rather than the bare "Previous" and "Next" they carry by default.

See also

© 2026 Curiosity. All rights reserved.