Featured Blog Post List

Installation

Add the following Soul components

The featured-blog-post-list component uses the blog-post-card, blog-post-list, breadcrumbs, cursor-pagination, section-layout and streamable components. Make sure you have added them to your project.

Copy and paste the following code into your project

sections/featured-blog-post-list/index.tsx

import { Streamable } from '@/vibes/soul/lib/streamable';import { type BlogPost } from '@/vibes/soul/primitives/blog-post-card';import { CursorPagination, CursorPaginationInfo } from '@/vibes/soul/primitives/cursor-pagination';import { BlogPostList } from '@/vibes/soul/sections/blog-post-list';import { type Breadcrumb, Breadcrumbs } from '@/vibes/soul/sections/breadcrumbs';import { SectionLayout } from '@/vibes/soul/sections/section-layout';export interface FeaturedBlogPostListProps {  title: string;  description?: string | null;  blogPosts: Streamable<BlogPost[]>;  paginationInfo?: Streamable<CursorPaginationInfo>;  breadcrumbs?: Streamable<Breadcrumb[]>;  emptyStateSubtitle?: Streamable<string>;  emptyStateTitle?: Streamable<string>;  placeholderCount?: number;}/** * This component supports various CSS variables for theming. Here's a comprehensive list, along * with their default values: * * ```css * :root { *   --featured-blog-post-list-font-family: var(--font-family-body); *   --featured-blog-post-list-title-font-family: var(--font-family-body); *   --featured-blog-post-list-title: var(--foreground); *   --featured-blog-post-list-description: var(--contrast-500); * } * ``` */export function FeaturedBlogPostList({  title,  description,  blogPosts,  paginationInfo,  breadcrumbs,  emptyStateSubtitle,  emptyStateTitle,  placeholderCount,}: FeaturedBlogPostListProps) {  return (    <SectionLayout>      {breadcrumbs && <Breadcrumbs breadcrumbs={breadcrumbs} />}      <div className="pt-6">        <header className="font-(family-name:--featured-blog-post-list-font-family,var(--font-family-body))">          <h1 className="mb-3 font-(family-name:--featured-blog-post-list-title-font-family,var(--font-family-heading)) text-4xl leading-none font-medium text-(--featured-blog-post-list-title,var(--foreground)) @xl:text-5xl @4xl:text-6xl">            {title}          </h1>          {description != null && description !== '' && (            <p className="max-w-lg text-lg text-(--featured-blog-post-list-description,var(--contrast-500))">              {description}            </p>          )}        </header>        <div className="group/blog-post-list">          <BlogPostList            blogPosts={blogPosts}            className="mt-8 mb-8 @4xl:mt-10 @4xl:mb-10"            emptyStateSubtitle={emptyStateSubtitle}            emptyStateTitle={emptyStateTitle}            placeholderCount={placeholderCount}          />        </div>        {paginationInfo && <CursorPagination info={paginationInfo} />}      </div>    </SectionLayout>  );}

Usage

import { FeaturedBlogPostList } from '@/vibes/soul/sections/featured-blog-post-list';function Usage() {  return (      <FeaturedBlogPostList          blogPosts={posts}          breadcrumbs={[              {                  id: '1',                  label: 'Home',                  href: '#',              },              {                  id: '2',                  label: 'Blog',                  href: '#',              },          ]}          description="Expert Tips & Inspiration for Every Outdoor Lover"          emptyStateSubtitle="Check back later for more content"          emptyStateTitle="No blog posts found"          paginationInfo={{              startCursor: '1',              endCursor: '5',          }}          placeholderCount={6}          title="Plant Life"      />  );}const posts = [  {    id: '5',    title: 'A Guide to Low-Light Houseplants',    content:      'Not all plants need bright sunlight to thrive. This guide highlights the best low-light houseplants, perfect for those darker corners of your home or office that need a touch of green.',    image: {      src: 'https://storage.googleapis.com/s.mkswft.com/RmlsZTo0NGVmOWFkZC00MDc5LTRmMTAtODIyMC0zM2UwNjNkMGRjZDM=/low-light.jpeg',      alt: 'Low-Light Houseplants',    },    date: '2024-07-20',    href: '#',    author: 'Author Name',  },];

API Reference

FeaturedBlogPostListProps

PropTypeDefault
className
string
title
string
description
string | null
blogPosts*
Streamable<BlogPost[]>
paginationInfo
Streamable<CursorPaginationInfo>
breadcrumbs
Streamable<Breadcrumb>
emptyStateSubtitle
Streamable<string>
emptyStateTitle
Streamable<string>
placeholderCount
number

BlogPost

PropTypeDefault
title*
string
author
string | null
content*
string
date*
string
image
{src: string; alt: string; } | null
href*
string

CursorPaginationInfo

PropTypeDefault
startCursorParamName
string
startCursor*
string | null
endCursorParamName
string
endCursor*
string | null
PropTypeDefault
label
string
href
string

CSS Variables

This component supports various CSS variables for theming. Here's a comprehensive list.

:root {  --featured-blog-post-list-font-family: var(--font-family-body);  --featured-blog-post-list-title-font-family: var(--font-family-body);  --featured-blog-post-list-title: var(--foreground);  --featured-blog-post-list-description: var(--contrast-500);}