
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@astro-bryceguy/pagination
Advanced tools
This is a collection of components for paginating data and creating link navigation
NOTE This package is old and deprecated, you can find a better version of these components here: astro-headless-ui
This is a collection of components for paginating data and creating link navigation
<Paginate>Paginate an array
Astro's paginate() function from getStaticPaths() inside of a component.
Example:
<Paginate page={Astro.params.page} data={await fetch('https://jsonplaceholder.typicode.com/posts').then(response => response.json())}>
{page => (
<section>
{ page.data.map(post => (
<article>
<h2>{post.title}</h2>
<p>{post.body}</p>
</article>
))}
</section>
)}
</Paginate>
<Pagination>Create link navigation using objects
Example:
<Pagination url="/posts" total="22" current="11" theme="inline"></Pagination>
Note: Recommended to use <AdvancedPagination>
<AdvancedPagination>Create link navigation using slots
Example:
<AdvancedPagination index total="22" current="11">
<f slot="active">{(page) => <span>{page.number}</span>}</f>
<f slot="disabled">{() => <span>...</span>}</f>
{(page) => <a href={page.href}>{page.number}</a>}
</AdvancedPagination>
This example uses the <Paginate> and <AdvancedPagination> components to paginate a list of posts from the JSONPaceholder API
---
import { Paginate, AdvancedPagination } from '@astro-bryceguy/pagination';
const posts = await fetch('https://jsonplaceholder.typicode.com/posts').then(response => response.json())
---
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>Astro</title>
</head>
<body>
<Paginate data={posts} size="10" page={Astro.params.page}>
{ page => (
<section>
{ page.data.map(post => (
<article>
<h2>{post.id} - {post.title}</h2>
<p>{post.body}</p>
</article>
))}
</section>
<nav>
<AdvancedPagination total={page.last} current={page.current} middle="1">
<f slot="active">{page => <span>{page.number}</span>}</f>
<f slot="disabled">{() => <span>...</span>}</f>
{page => <a href={page.href}>{page.number}</a>}
</AdvancedPagination>
</nav>
)}
</Paginate>
</body>
</html>
FAQs
This is a collection of components for paginating data and creating link navigation
The npm package @astro-bryceguy/pagination receives a total of 0 weekly downloads. As such, @astro-bryceguy/pagination popularity was classified as not popular.
We found that @astro-bryceguy/pagination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.