# `src/components/pagination/Pagination.ts`:

## class: `Pagination`, `btu-pagination`

### Superclass

| Name         | Module | Package |
| ------------ | ------ | ------- |
| `LitElement` |        | lit     |

### Mixins

| Name                | Module                         | Package |
| ------------------- | ------------------------------ | ------- |
| `EventEmitterMixin` | /src/util/EventEmitterMixin.js |         |
| `ReadyMixin`        | /src/util/ReadyMixin.js        |         |

### Fields

| Name                     | Privacy | Type                  | Default        | Description                                                                                                                                                                             | Inherited From |
| ------------------------ | ------- | --------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `page`                   |         | `number`              | `1`            | Current page number (1-based)                                                                                                                                                           |                |
| `pageSize`               |         | `number`              | `0`            | Number of items per page                                                                                                                                                                |                |
| `disabled`               |         | `boolean`             | `false`        | Disables all pagination controls                                                                                                                                                        |                |
| `loading`                |         | `boolean`             | `false`        | Shows loading spinner and dims controls                                                                                                                                                 |                |
| `hideOnSinglePage`       |         | `boolean`             | `true`         | Hide controls when there is only one page                                                                                                                                               |                |
| `pageSizeChanger`        |         | `boolean`             | `true`         | Show the page size dropdown                                                                                                                                                             |                |
| `pageSizeOptions`        |         | `string`              | `'10, 20, 50'` | Comma-separated page size options                                                                                                                                                       |                |
| `totalItems`             |         | `number`              | `0`            | Total number of items across all pages                                                                                                                                                  |                |
| `boundaryButtons`        |         | `boolean`             | `true`         | Show first and last page buttons                                                                                                                                                        |                |
| `hideTotalCount`         |         | `boolean`             | `false`        | Hide the item count display (e.g., "1-10 of 200")                                                                                                                                       |                |
| `pageJumper`             |         | `boolean`             | `false`        | Show the page jumper dropdown. Intended for moderate page counts (under \~100 pages).&#xA;For large datasets, use a custom \`slot="jumper"\` with a virtualized or input-based control. |                |
| `label`                  |         | `string \| undefined` |                | Accessible label for the pagination nav landmark                                                                                                                                        |                |
| `_parsedPageSizeOptions` | private | `number[]`            |                |                                                                                                                                                                                         |                |
| `_totalPages`            | private | `number`              |                |                                                                                                                                                                                         |                |
| `_startItem`             | private | `number`              |                |                                                                                                                                                                                         |                |
| `_endItem`               | private | `number`              |                |                                                                                                                                                                                         |                |

### Methods

| Name                       | Privacy | Description                                                                                                                                                                                                                                                                        | Parameters                                              | Return    | Inherited From    |
| -------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------- | ----------------- |
| `_setupSlots`              | private |                                                                                                                                                                                                                                                                                    |                                                         | `void`    |                   |
| `_goToFirstPage`           | private |                                                                                                                                                                                                                                                                                    | `e: Event`                                              | `void`    |                   |
| `_goToPreviousPage`        | private |                                                                                                                                                                                                                                                                                    | `e: Event`                                              | `void`    |                   |
| `_goToNextPage`            | private |                                                                                                                                                                                                                                                                                    | `e: Event`                                              | `void`    |                   |
| `_goToLastPage`            | private |                                                                                                                                                                                                                                                                                    | `e: Event`                                              | `void`    |                   |
| `_manageBoundaryFocus`     | private |                                                                                                                                                                                                                                                                                    | `clickedButton: IconButton`                             | `void`    |                   |
| `_onBuiltinPageSizeSelect` | private |                                                                                                                                                                                                                                                                                    | `e: Event`                                              | `void`    |                   |
| `_onBuiltinJumperSelect`   | private |                                                                                                                                                                                                                                                                                    | `e: Event`                                              | `void`    |                   |
| `emit`                     |         | Dispatches a type-safe CustomEvent with standardized configuration.&#xA;&#xA;All events are configured with:&#xA;- bubbles: true (event propagates up the DOM tree)&#xA;- cancelable: false (event cannot be cancelled)&#xA;- composed: true (event crosses shadow DOM boundaries) | `type: K, detail: UnpackCustomEvent<CustomEventMap[K]>` | `boolean` | EventEmitterMixin |

### Events

| Name                              | Type                                            | Description               | Inherited From |
| --------------------------------- | ----------------------------------------------- | ------------------------- | -------------- |
| `btu-pagination-ready`            | `CustomEvent`                                   | Fired after first render  |                |
| `btu-pagination-change`           | `CustomEvent<{page: number, pageSize: number}>` | Fired on page navigation  |                |
| `btu-pagination-page-size-change` | `CustomEvent<{page: number, pageSize: number}>` | Fired on page size change |                |

### Attributes

| Name                  | Field            | Inherited From |
| --------------------- | ---------------- | -------------- |
| `page`                | page             |                |
| `page-size`           | pageSize         |                |
| `disabled`            | disabled         |                |
| `loading`             | loading          |                |
| `hide-on-single-page` | hideOnSinglePage |                |
| `page-size-changer`   | pageSizeChanger  |                |
| `page-size-options`   | pageSizeOptions  |                |
| `total-items`         | totalItems       |                |
| `boundary-buttons`    | boundaryButtons  |                |
| `hide-total-count`    | hideTotalCount   |                |
| `page-jumper`         | pageJumper       |                |
| `label`               | label            |                |

### CSS Properties

| Name                            | Default | Description                                         |
| ------------------------------- | ------- | --------------------------------------------------- |
| `--pagination-color-background` |         | Background color for dropdowns, buttons, and jumper |
| `--pagination-color-foreground` |         | Text/icon color                                     |

### Slots

| Name        | Description                                                                                    |
| ----------- | ---------------------------------------------------------------------------------------------- |
| `page-size` | Custom page-size selector (replaces built-in dropdown). Consumer manages all behavior.         |
| `jumper`    | Custom jumper content (replaces built-in page jumper dropdown). Consumer manages all behavior. |

<hr/>

## Exports

| Kind                        | Name             | Declaration | Module                                  | Package |
| --------------------------- | ---------------- | ----------- | --------------------------------------- | ------- |
| `js`                        | `default`        | Pagination  | src/components/pagination/Pagination.ts |         |
| `custom-element-definition` | `btu-pagination` | Pagination  | src/components/pagination/Pagination.ts |         |
