Social Post

One post in a feed: author, time, text with links and tags, an optional image, and reply, repost and like counts.

Still Coffee@stillcoffee
The Huila lot rested nine days and it is ready. A pour-over brings out the red fruit: 15 g of coffee, 250 ml of water, about three minutes. Tasting on Saturday at 10:00 with @maren_roasts. #pourover
A slender stream of coffee pours into the cobalt cup.
Views24.6K
'use client';

import { SocialPost } from '@brand-studio/ui';
import { pour } from '@/demos/assets';

export default function SocialPostDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 560 }}>
      <SocialPost author={{ name: 'Still Coffee', handle: 'stillcoffee', verified: true }} time="2h" media={pour} replies={18} reposts={42} likes={1280} views={24600}>
        {'The Huila lot rested nine days and it is ready. A pour-over brings out the red fruit: 15 g of coffee, 250 ml of water, about three minutes.\n\nTasting on Saturday at 10:00 with @maren_roasts. #pourover'}
      </SocialPost>
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { SocialPost } from '@brand-studio/ui';
<SocialPost
  author={{ name: 'Still Coffee', handle: 'stillcoffee', verified: true }}
  time="2h"
  dateTime="2026-10-08T07:30:00Z"
  media={pour}
  replies={18}
  reposts={42}
  likes={1280}
  onLikeChange={liked => save(postId, liked)}
>
  {'Tasting on Saturday at 10:00 with @maren_roasts. #pourover https://example.com/tasting'}
</SocialPost>

Pass the text as a plain string and the post finds links, @mentions and #tags and sets them in the accent colour. Line breaks in the string become line breaks in the post. Pass elements instead when you want to mark up the body yourself.

Like and repost are toggles. Each press adds you to the count or takes you off it, and calls onLikeChange or onRepostChange, so you can save it. Counts over a thousand read as 1.3K. Leave out views to hide the views figure.

The avatar is the first letter of the name unless you pass avatar, such as an <img>.

Accessibility

  • Each post is an article named by its author and time.
  • Reply, Repost and Like are buttons named in words with their counts; Like and Repost report aria-pressed.
  • The verified mark is an image named Verified.
  • Links in the text open in the same tab and are real links you can tab to.

API Reference

PropTypeDefault
authorPostAuthor–
timestring–
dateTime?string–
childrenReact.ReactNode–
media?ImageAsset–
replies?number–
reposts?number–
likes?number–
views?number–
defaultLiked?boolean–
defaultReposted?boolean–
onReply?(() => void)–
onLikeChange?((liked: boolean) => void)–
onRepostChange?((reposted: boolean) => void)–
className?string–

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