PhoenixBlog.Web.Components.RecentPosts (phoenix_blog v0.1.7)

Copy Markdown View Source

A LiveComponent that displays the latest blog posts.

Embed it in any LiveView page to show recent posts:

<.live_component
  module={PhoenixBlog.Web.Components.RecentPosts}
  id="recent-posts"
  blog_path="/blog"
/>

Attributes

  • blog_path (required) - The path where your blog is mounted
  • count - Number of posts to show (default: 3)
  • title - Section title (default: "Latest Posts")
  • class - Additional CSS classes for the wrapper