Skip to content
New

Gallery, social

beta

The project's own photos in a square three-column grid, like a profile's feed, with the account's handle and a follow link.

npx rasengan-ui add gallery-social
Use it
A business whose social account is lively: food, beauty, fashion. Its photos are copied into the project.
Avoid it
Photos that need a caption or a closer look: gallery-grid opens them in a lightbox.
Built with
Button

Installation

Terminal
npx rasengan-ui add gallery-social

It installs into components/blocks/gallery-social/, with what it uses (Button) and lib/blocks.ts.

Usage

Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):

app/_routes/index.page.tsx
import { GallerySocial } from "@/components/blocks/gallery-social";
import { home } from "@/content/home";
 
export default function Home() {
  return <GallerySocial content={home.gallery} />;
}
content/home.ts
import { example, type GallerySocialContent } from "@/components/blocks/gallery-social";
 
export const home = {
  gallery: { ...example, title: "Follow us" } satisfies GallerySocialContent,
};

The photos are files in your project, shown square: nothing is embedded or loaded from a social network. Copy a few recent posts in by hand, or from your build. The follow button links to account.href.

Content

FieldTypeLimitsGuidance
titlestring2–48 chars'Follow us', 'From our kitchen'.
sublineoptionalstring≤ 160 chars
accountobject
account.handlestring2–32 charsAs people search for it: '@mamangono'.
account.hrefstringuriThe profile's address.
account.followstring1–24 charsThe button: 'Follow us', 'See more on Instagram'.
photosobject[]3–9 itemsThe project's own photos, shown square: three, six or nine. Nothing is loaded from the network.
photos[].srcstringA local path ('/images/terrace.jpg') or the project's asset URL.
photos[].altstring≤ 140 charsWhat the image shows, for people who cannot see it. Empty only if purely decorative.
photos[].widthinteger
photos[].heightinteger

Props

PropNotes
contentGallerySocialContent; the example when left out
idthe section's id, for anchor links; "gallery" by default
headingLevel1, 2 or 3: the heading's tag; 2 by default
classNameon the <section>, for spacing

Accessibility

  • Each photo has its own alt.
  • The follow link says where it goes: the button text and the handle.