Two changes for the Huila lot, from this morning's cupping.
Still Coffee@stillcoffee Still Coffee@stillcoffee Grind one step coarser. At our old setting the cup turned bitter by the third minute.Still Coffee@stillcoffee Water at 94°C, not boiling. The red fruit holds. #pourover
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/uinpm install @brand-studio/uiyarn add @brand-studio/uibun add @brand-studio/uiInstall the peer dependencies
npm install react react-domImport the stylesheet once
import '@brand-studio/ui/styles.css';Wrap your app in a brand theme
import { BrandTheme, PostThread } from '@brand-studio/ui'; import brand from './brand.json'; <BrandTheme palette={brand.tokens} mode="system"> {/* your app */} </BrandTheme>
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
| Prop | Type | Default |
|---|---|---|
children | React.ReactNode | – |
label? | string | – |
className? | string | – |