Svelte Pagination - Bitblue

Previous/next page controls with optional record count and column visibility for tables

Paginate is the Bitblue pagination control used under tables and datatables. Wire page state and handlers from the parent; keep interactive counters in example fences when needed.

Setup

<script lang="ts">
	import { Paginate } from '.';
</script>

Default

Page 2/8
(128)
<script lang="ts">
	import { Paginate } from '.';
	let currentPage = $state(1);
	const totalPages = 5;
</script>

<Paginate
	{currentPage}
	{totalPages}
	recordCount={42}
	hasPreviousPage={currentPage > 1}
	hasNextPage={currentPage < totalPages}
	onPreviousPage={() => currentPage--}
	onNextPage={() => currentPage++}
	hideLabel={false}
/>

Compact (hide labels)

By default hideLabel is true (icon-only prev/next).

1/3
<Paginate
	currentPage={1}
	totalPages={3}
	hasPreviousPage={false}
	hasNextPage={true}
	onPreviousPage={() => {}}
	onNextPage={() => {}}
/>

Small text

Page 4/12
(240)

Refresh control

Pass refresh to show a reload icon.

Page 1/4
<script lang="ts">
	import { Paginate } from '.';
</script>

<Paginate
	currentPage={1}
	totalPages={4}
	hasPreviousPage={false}
	hasNextPage={true}
	onPreviousPage={() => {}}
	onNextPage={() => {}}
	refresh={() => console.log('reload')}
	hideLabel={false}
/>

Column visibility menu

When tableColumns is non-empty, a columns dropdown appears. Bind hiddenColumns to sync visibility with your table.

Page 1/2
<script lang="ts">
	import { Paginate } from '.';
	let hiddenColumns = $state(['role']);
	const tableColumns = [
		{ header: 'Name', id: 'name' },
		{ header: 'Email', id: 'email' },
		{ header: 'Role', id: 'role' }
	];
</script>

<Paginate
	currentPage={1}
	totalPages={2}
	hasPreviousPage={false}
	hasNextPage={true}
	onPreviousPage={() => {}}
	onNextPage={() => {}}
	{tableColumns}
	bind:hiddenColumns
	hideLabel={false}
/>

Props

PropTypeDefaultDescription
currentPagenumber—Active page (required)
totalPagesnumber—Total page count (required)
hasNextPageboolean—Enable next control (required)
hasPreviousPageboolean—Enable previous control (required)
onNextPage() => void—Next handler (required)
onPreviousPage() => void—Previous handler (required)
refresh(() => void) \| nullnullOptional reload callback / icon
hideLabelbooleantrueHide “PREV” / “NEXT” / “Page” text
textSmallbooleanfalseSmaller typography
recordCountnumber0Optional total records shown as (n)
pageSizenumber—Page size (typed for table integrations)
tableColumnsany[][]When set, shows column visibility menu
hiddenColumnsstring[][]Bindable hidden column ids

© 2026 Bitblue is a registered trademark. All Rights Reserved.