#133
Basic
Pagination for 100 items at 10 per page, with the current page bound to state and printed below.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Basic" pattern (@codeatlasdev/ui demo #133, display/pagination) in my app.
Call get_demo({ ids: ["#133"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Paged lists and tables where the app needs to know the active page to fetch or slice data.
Keep these library parts, with the props and tokens the demo uses:
- Pagination from "@codeatlasdev/ui"
Behaviour to keep:
- `<Pagination count={100} perPage={10} bind:page />`
- State: `let page = $state(1)` starts on page 1
- A paragraph renders `Current page: {page}` below the control
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Pagination
@codeatlasdev/ui
How it is built
- `<Pagination count={100} perPage={10} bind:page />`
- State: `let page = $state(1)` starts on page 1
- A paragraph renders `Current page: {page}` below the control
Related
Loading source.