A self-contained blog feed LiveComponent with search, tag filters, and pagination.
Embed it in any host app LiveView:
<.live_component
module={PhoenixBlog.Web.Components.BlogFeed}
id="blog-feed"
blog_path="/blog"
/>Customization with slots
Override the default post card rendering:
<.live_component
module={PhoenixBlog.Web.Components.BlogFeed}
id="blog-feed"
blog_path="/blog"
>
<:post_card :let={post}>
<div class="my-custom-card">
<h3>{post.title}</h3>
</div>
</:post_card>
</.live_component>Attributes
blog_path(required) - The path where your blog is mountedper_page- Items per page (default: 12)show_search- Show search bar (default: true)show_tags- Show tag filter buttons (default: true)show_hero- Show hero banner with title and count (default: false)class- Additional CSS classes for the wrappergrid_class- CSS classes for the posts grid container
Slots
:post_card- Custom rendering for each post card. Receives the post via:let.:empty- Custom empty state content.