Gallery, social
betaThe 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
From our kitchen
What came out of the pots this week. Tag us when you eat with us.
- 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
- Pairs with
- Contact, linksReviews, rating
Installation
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):
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
| Field | Type | Limits | Guidance |
|---|---|---|---|
title | string | 2–48 chars | 'Follow us', 'From our kitchen'. |
sublineoptional | string | ≤ 160 chars | |
account | object | ||
account.handle | string | 2–32 chars | As people search for it: '@mamangono'. |
account.href | string | uri | The profile's address. |
account.follow | string | 1–24 chars | The button: 'Follow us', 'See more on Instagram'. |
photos | object[] | 3–9 items | The project's own photos, shown square: three, six or nine. Nothing is loaded from the network. |
photos[].src | string | A local path ('/images/terrace.jpg') or the project's asset URL. | |
photos[].alt | string | ≤ 140 chars | What the image shows, for people who cannot see it. Empty only if purely decorative. |
photos[].width | integer | ||
photos[].height | integer |
Props
| Prop | Notes |
|---|---|
content | GallerySocialContent; the example when left out |
id | the section's id, for anchor links; "gallery" by default |
headingLevel | 1, 2 or 3: the heading's tag; 2 by default |
className | on the <section>, for spacing |
Accessibility
- Each photo has its own
alt. - The follow link says where it goes: the button text and the handle.