Post Thread

Posts that answer one another, in order, joined by a line between their avatars.

  1. Still Coffee@stillcoffee
    Two changes for the Huila lot, from this morning's cupping.
  2. Still Coffee@stillcoffee
    Grind one step coarser. At our old setting the cup turned bitter by the third minute.
  3. Still Coffee@stillcoffee
    Water at 94°C, not boiling. The red fruit holds. #pourover
    A cobalt ceramic cup of coffee on a brushed steel counter in morning light.
  4. Maren Holt@maren_roasts
    @stillcoffee Tried both at home with a cone dripper. Sweeter, less bite.
'use client';

import { PostThread, SocialPost } from '@brand-studio/ui';
import { cup } from '@/demos/assets';

const still = { name: 'Still Coffee', handle: 'stillcoffee', verified: true };

export default function PostThreadDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 560 }}>
      <PostThread label="Brewing the Huila lot">
        <SocialPost author={still} time="3h" replies={6} reposts={14} likes={312}>Two changes for the Huila lot, from this morning's cupping.</SocialPost>
        <SocialPost author={still} time="3h" replies={2} reposts={9} likes={204}>Grind one step coarser. At our old setting the cup turned bitter by the third minute.</SocialPost>
        <SocialPost author={still} time="3h" media={cup} replies={4} reposts={11} likes={268}>{'Water at 94°C, not boiling. The red fruit holds. #pourover'}</SocialPost>
        <SocialPost author={{ name: 'Maren Holt', handle: 'maren_roasts' }} time="1h" likes={37}>{'@stillcoffee Tried both at home with a cone dripper. Sweeter, less bite.'}</SocialPost>
      </PostThread>
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { PostThread, SocialPost } from '@brand-studio/ui';
<PostThread label="Brewing the Huila lot">
  <SocialPost author={still} time="3h">Two changes for the Huila lot, from this morning's cupping.</SocialPost>
  <SocialPost author={still} time="3h">Grind one step coarser.</SocialPost>
  <SocialPost author={maren} time="1h">{'@stillcoffee Tried both at home. Sweeter, less bite.'}</SocialPost>
</PostThread>

Put SocialPost items inside, oldest first. The thread draws one frame around them and a line from each avatar down to the next, so a reader can follow who answered whom.

Accessibility

  • The thread is an ordered list named by label, so screen readers announce how many posts it holds and where each one sits.
  • Each post keeps its own article name, buttons and links.

API Reference

PropTypeDefault
childrenReact.ReactNode–
label?string–
className?string–

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.