Skip to content
GetUrUI

Social posts

4 variantsNew
.md

Four feed posts — text, photo grid, poll and link preview — with optimistic toggles, rolling counts, a shared-layout photo viewer and results that count up.

socialpostfeedlikerepostpollimage gridlink previewtimeline

Text post

text-post.tsx

Text post with optimistic like, repost and bookmark: icons pop, the like bursts and counts roll.

$npx shadcn@latest add @geturui/social-posts-text-post
.zip
PropTypeDefaultDescription
author / handle / timestring—Header content.
verifiedbooleantrueShow the verified badge.
bodystring[]—Paragraphs of the post.
replies / reposts / likes / viewsnumber—Counts from other people.
defaultLiked / defaultReposted / defaultBookmarkedbooleanfalseInitial viewer state.
onReply / onChange() => void / (state) => void—Reply handler and toggle state callback.
classNamestring—Extra classes on the root element.

Photo grid

image-grid.tsx

Photo post whose drawn grid tiles expand into a viewer with a shared-layout morph, arrow paging and Escape to close.

$npx shadcn@latest add @geturui/social-posts-image-grid
.zip
PropTypeDefaultDescription
author / place / time / captionstring—Post content.
imagesPostImage[]—{ scene, alt } per tile, up to four; swap Scene for your <img> in real use.
likes / commentsnumber—Counts.
onLikeChange(liked: boolean) => void—Like toggle handler.
classNamestring—Extra classes on the root element.

Poll

poll.tsx

Poll post where voting grows the result bars and counts percentages up, with your choice marked and undo.

$npx shadcn@latest add @geturui/social-posts-poll
.zip
PropTypeDefaultDescription
author / handle / timestring—Header content.
questionstring—Poll question.
optionsPollOption[]—{ id, label, votes } per option.
remainingstring"2 days left"Time-left label.
defaultVote / onVotestring | null / (id: string | null) => void—Existing vote and change handler (null on undo).
classNamestring—Extra classes on the root element.

Install the whole set

Installs every social posts variant at once. Each section above has its own command for a single variant.

$npx shadcn@latest add @geturui/social-posts
Download source (.zip)

Accessibility

  • Like, repost and bookmark are toggle buttons with aria-pressed and counts in their labels.
  • The photo viewer is a labelled dialog: focus moves to Close, arrows page, Escape closes and focus returns to the tile.
  • Poll results are announced in a live region; bursts, morphs and count-ups are reduced to fades.

Related