HiveAuthorPostList
Display top-level posts authored by a specific Hive account, with optional client-side tag filter and cursor-based Prev/Next pagination.
Uses bridge.get_account_posts
Fetches top-level posts from the Hive blockchain via the Bridge API for a specific account (sort is fixed to "posts"). Use the tag prop to additionally filter by a Hive tag (client-side filter on the returned page). Requires a HiveProvider wrapper.
Usage
<script lang="ts">
import { HiveAuthorPostList } from "@hiveio/honeycomb-svelte";
</script>
<HiveAuthorPostList account="hiveio" />Preview
Welcome to Hive - Getting Started Guide
@hiveio
Hive Improvement Proposals: How They Work
@hiveio
Building on Hive: Developer Resources
@hiveio
Props
| Prop | Type | Default | Description |
|---|---|---|---|
account | string | required | Hive account name to fetch posts for |
tag | string | - | Optional client-side tag filter applied to the returned page |
limit | number | 20 | Posts per page (see Pagination note below) |
pinned_posts | AccountPost[] | - | Full AccountPost objects rendered above the list. Unlike HivePostList, no extra fetch is performed. |
variant | "card" | "compact" | "grid" | "compact" | Layout variant for post items |
hide | ("author" | "thumbnail" | "payout" | "votes" | "comments" | "time")[] | [] | Elements to hide from post cards |
linkTarget | string | "https://blog.openhive.network" | Base URL for post links. Only http(s):// and root-relative paths are accepted; invalid values fall back to the default. |
class | string | - | Additional CSS classes applied to the wrapper |
api_endpoint | string | from HiveProvider | Override the API endpoint for this component instance |
Pagination behavior
The first page returns up to limit posts. Subsequent pages return up to min(limit, 19) posts because bridge.get_account_posts consumes one slot for the cursor (start_author / start_permlink). This is an upstream Hive API constraint, not a component limitation.
Tag filter
Combine account with tag to show only posts of that author tagged with a specific Hive tag. The filter is applied client-side to the returned page.
<script lang="ts">
import { HiveAuthorPostList } from "@hiveio/honeycomb-svelte";
</script>
<!-- Filter posts by an author and a specific tag. -->
<HiveAuthorPostList
account="hiveio"
tag="hivedev"
/>Pinned posts
Unlike HivePostList (which accepts { author, permlink } and refetches each pinned post), HiveAuthorPostList expects full AccountPost objects so pinned posts can be rendered without an extra API call (avoiding N+1 fetches).
<script lang="ts">
import { HiveAuthorPostList } from "@hiveio/honeycomb-svelte";
import type { AccountPost } from "@hiveio/honeycomb-core";
// Unlike HivePostList, pinned posts here are full AccountPost objects
// (no extra fetch — rendered directly).
const pinned: AccountPost[] = [
/* full AccountPost objects from a previous fetch */
];
</script>
<HiveAuthorPostList
account="hiveio"
pinned_posts={pinned}
/>useHiveAuthorPostList Hook
For full control, use the useHiveAuthorPostList hook directly. It returns posts, loading state, and cursor-based pagination controls.
Return values
| Property | Type | Description |
|---|---|---|
posts | AccountPost[] | Current page of posts authored by account |
is_loading | boolean | Whether data is being fetched |
error | Error | null | Fetch error, if any |
page | number | Current page number (1-based) |
has_prev / has_next | boolean | Whether previous/next page exists |
prev_page / next_page | () => void | Navigate to previous/next page |
Example
<script lang="ts">
import { useHiveAuthorPostList } from "@hiveio/honeycomb-svelte";
const feed = useHiveAuthorPostList({
account: "hiveio",
limit: 10,
});
</script>
{#if feed.is_loading}
<p>Loading...</p>
{:else if feed.error}
<p>Error: {feed.error.message}</p>
{:else}
<div>
<p>Page {feed.page}</p>
<ul>
{#each feed.posts as p (`${p.author}/${p.permlink}`)}
<li>{p.title}</li>
{/each}
</ul>
<button onclick={feed.prev_page} disabled={!feed.has_prev}>Prev</button>
<button onclick={feed.next_page} disabled={!feed.has_next}>Next</button>
</div>
{/if}