Skip to content
synccn

Post Card

New

Social post with like, repost and share counts.

J
Jayden@jayden · 3h
Just shipped dark mode for our dashboard using one set of CSS variables. Took an afternoon, not a sprint.

Installation

$ pnpm dlx shadcn@latest add @synccn/post-card

First time in this project? Connect synccn with one command.

Usage

import { PostCard } from "@/components/ui/cards";<PostCard name="Jayden" handle="@jayden" likes={1284}>…</PostCard>

API reference

Generated from the component's TypeScript types, so it always matches the code.

PostCard

Social post with like, repost and share actions that update their counts.

  • namerequired
    string

    Author name.

  • handle
    string

    Author username.

  • time
    string

    Relative time, e.g. 3h.

  • media
    React.ReactNode

    Image or video under the text.

  • likes
    number

    Default 0

    Starting like count.

  • reposts
    number

    Default 0

    Starting repost count.

  • replies
    number

    Default 0

    Reply count.

  • children
    React.ReactNode

    Content to render.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Components

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-label, aria-pressed