Posts tabs — Social block
Prosocial-posts-tabs · for home, landing pages
Posts tabs
A button per platform to switch the posts shown: a brand present on several networks; the merchant’s own only
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/social-posts-tabsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import SocialPostsTabs from '@/components/trame/blocks/social/social-posts-tabs.vue'
const props = {
title: "On Instagram this season",
subtitle: "Our latest posts, just as we wrote them.",
platform: "instagram",
posts: [
{
text: "Last firing of the season: the glazed stoneware bowls came out of the kiln this morning.",
image: "https://images.unsplash.com/photo-1484632105053-8662f3194e7f?w=1600&q=80",
alt: "Bowls and plates stacked on a shelf",
url: "https://example.com/p/1",
author: "@atelier.lumiere",
date: "Sep 12",
metrics: "1.2K likes",
duration: "0:42"
},
{
text: "In the studio: today’s glaze.",
image: "https://images.unsplash.com/photo-1589051088132-06f36a22012a?w=1600&q=80",
alt: "A potter’s hands smoothing the wall of a piece on the wheel",
url: "https://example.com/p/2",
author: "@atelier.lumiere",
date: "Sep 9",
metrics: "860 likes",
duration: "1:15"
}
],
followAction: {
label: "Follow us",
url: "https://example.com/atelier.lumiere"
}
}
</script>
<template>
<SocialPostsTabs v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title | string | Wordswhat the feed is ("On Instagram this season") |
| subtitle | string | Wordsa sentence on the feed |
| platform | 'instagram' | 'tiktok' | 'youtube' | 'x' | 'facebook' | 'pinterest' | 'linkedin' | 'other' | the platform of the posts, when they share one |
| posts* | Post[] | Datathe merchant’s own posts |
| followAction | FollowAction | the link to the shop’s social account, e.g. "Follow us" |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Post posts[] · 9 props
| Prop | Type | Description |
|---|---|---|
| text | string | Wordsthe post’s text, as published |
| image | string | Picturethe post’s picture or video thumbnail |
| alt | string | Wordswhat the picture shows, when the text does not say it |
| url* | string | Designthe address of the post on its platform |
| author | string | Wordsthe account’s name ("@atelier.lumiere") |
| date | string | Wordsthe date as the merchant writes it ("12 September") |
| duration | string | Wordsa video’s length ("3:24") |
| metrics | string | Wordsthe counts as the platform shows them ("1.2k views"); omit rather than invent |
| platform | 'instagram' | 'tiktok' | 'youtube' | 'x' | 'facebook' | 'pinterest' | 'linkedin' | 'other' | platform-tabs: the platform this post lives on |
FollowAction followAction · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words("Follow us") |
| url* | string | Designthe address of the merchant’s account |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| viewLabel | string | Wordsthe words of a post’s link ("See the post") |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Reads
postsfrom your app
A social section, for home, landing pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More social blocks
- Feed highlight: one large post with its picture and a link: the one post worth showing; the merchant’s own only.
- Feed video strip: video thumbnails with their length, title and views: a channel to watch; the merchant’s own only.
- Gallery grid: square pictures whose counts show on hover and focus: a visual account; the merchant’s own only.
- Gallery mosaic with tile: a home band that should send people to the merchant’s account as much as show pictures: a mosaic whose first cell holds the account, the title and the follow button, one picture spanning two columns; the merchant’s own only.