Pagination
Page navigation with previous/next and page links
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Pagination } from '@dryui/ui';
</script>
<Pagination.Root>
<Pagination.Content>...</Pagination.Content>
<Pagination.Item>...</Pagination.Item>
<Pagination.Previous>...</Pagination.Previous>
<Pagination.Next>...</Pagination.Next>
<Pagination.Link>...</Pagination.Link>
<Pagination.Ellipsis>...</Pagination.Ellipsis>
</Pagination.Root>Import options
Root package
import { Pagination } from '@dryui/ui'Per-component subpath
import { Pagination } from '@dryui/ui/pagination'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Basic Pagination
<script lang="ts">
let page = $state(1);
</script>
<Pagination.Root bind:page totalPages={10}>
<Pagination.Content>
<Pagination.Item>
<Pagination.Previous>Previous</Pagination.Previous>
</Pagination.Item>
<Pagination.Item>
<Pagination.Link page={1}>1</Pagination.Link>
</Pagination.Item>
<Pagination.Item>
<Pagination.Link page={2}>2</Pagination.Link>
</Pagination.Item>
<Pagination.Item>
<Pagination.Link page={3}>3</Pagination.Link>
</Pagination.Item>
<Pagination.Item>
<Pagination.Ellipsis />
</Pagination.Item>
<Pagination.Item>
<Pagination.Link page={10}>10</Pagination.Link>
</Pagination.Item>
<Pagination.Item>
<Pagination.Next>Next</Pagination.Next>
</Pagination.Item>
</Pagination.Content>
</Pagination.Root>Structure
Compound components always start with Pagination.Root. Use this structure block to understand required wrappers before you wire state or styling.
Pagination.Root Pagination.Content Pagination.Item Pagination.Previous Pagination.Next Pagination.Link Pagination.Ellipsis
Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with Pagination.Root, then add only the parts you need.
Pagination.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
page | number | 1 | — | — |
totalPages | number | — | ✓ | — |
children | Snippet | — | ✓ | — |
Forwards <element> attributes via rest props. Common examples: id, class, aria-label.
Pagination.Content
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <ul> attributes via rest props. Common examples: id, style, aria-labelledby.
Pagination.Item
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <li> attributes via rest props. Common examples: id, role, value.
Pagination.Previous
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.
Pagination.Next
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.
Pagination.Link
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
page | number | — | ✓ | — |
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.
Pagination.Ellipsis
| Prop | Type | Default | Required | Bindable |
|---|
Forwards <span> attributes via rest props. Common examples: id, style, aria-label.