Feed highlight — Social block

Pro

social-feed-highlight · for home, landing pages

Feed highlight

One large post with its picture and a link: the one post worth showing; 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-feed-highlight

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import SocialFeedHighlight from '@/components/trame/blocks/social/social-feed-highlight.vue'

const props = {
title: "On our feed this season",
subtitle: "Our latest posts, just as we wrote them.",
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>
<SocialFeedHighlight v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
titlestringWordswhat the feed is ("On Instagram this season")
subtitlestringWordsa sentence on the feed
posts*Post[]Datathe merchant’s own posts
followActionFollowActionthe link to the shop’s social account, e.g. "Follow us"
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Post posts[] · 9 props
PropTypeDescription
textstringWordsthe post’s text, as published
imagestringPicturethe post’s picture or video thumbnail
altstringWordswhat the picture shows, when the text does not say it
url*stringDesignthe address of the post on its platform
authorstringWordsthe account’s name ("@atelier.lumiere")
datestringWordsthe date as the merchant writes it ("12 September")
durationstringWordsa video’s length ("3:24")
metricsstringWordsthe 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
PropTypeDescription
label*stringWords("Follow us")
url*stringDesignthe address of the merchant’s account
Options options · 2 props
PropTypeDescription
viewLabelstringWordsthe words of a post’s link ("See the post")
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
asseta picture’s address as your app serves it
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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
  • Expressive motion, within its budget; still under reduced motion
  • Real buttons and links, a visible focus
  • Reads posts from 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

  • 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.
  • Posts cards: a row of text cards, a post each with its author and date: words that speak better than pictures; the merchant’s own only.
  • Posts tabs: a button per platform to switch the posts shown: a brand present on several networks; the merchant’s own only.

All 6 social blocks