Skip to content

Commit

Permalink
next: expose currentPage snippet prop (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Oct 14, 2024
1 parent 1942c35 commit a862805
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-berries-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

expose `currentPage` to the `Pagination.Root` snippets
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class PaginationRootState {
snippetProps = $derived.by(() => ({
pages: this.pages,
range: this.range,
currentPage: this.page.current,
}));

props = $derived.by(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type ChildSnippetProps = {
pages: PageItem[];
/** The range of pages to render */
range: { start: number; end: number };
/** The currently active page */
currentPage: number;
props: Record<string, unknown>;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ type ChildrenSnippetProps = {
pages: PageItem[];
/** The range of pages to render */
range: { start: number; end: number };
/** The currently active page */
currentPage: number;
};
```

0 comments on commit a862805

Please sign in to comment.