Product features accordion picture — Storefront block

Free

storefront-product-features-accordion-picture · for product, landing pages

Product features accordion picture

A few features that each deserve a sentence: a picture beside an accordion, the picture following the open panel

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/storefront-product-features-accordion-picture

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontProductFeaturesAccordionPicture from '@/components/trame/blocks/storefront/storefront-product-features-accordion-picture.vue'

const props = {
eyebrow: "Why this bag",
title: "Made to last, designed to be repaired",
features: [
{
title: "Vegetable-tanned leather",
body: "Tanned with chestnut bark for six weeks: it develops a patina, it doesn’t crack.",
media: "https://images.unsplash.com/photo-1716295177956-420a647c83ac?w=1600&q=80",
alt: "Detail of a bag’s leather and stitching",
icon: "leaf",
group: "Material"
},
{
title: "Saddle stitching",
body: "Two needles, one waxed thread: if one stitch gives, the rest holds.",
media: "https://images.unsplash.com/photo-1635100299010-0410d7434a93?w=1600&q=80",
alt: "A hand-stitched leather wallet and wooden saddler’s tools",
icon: "wrench",
group: "Material"
}
],
figures: [
{
value: "2 years",
label: "warranty, parts and labor"
},
{
value: "6 weeks",
label: "of vegetable tanning"
}
],
closing: "Two-year warranty, parts and labor.",
actions: [
{
label: "See the warranty",
action: "page",
record: {
id: "garantie"
}
}
]
}
</script>

<template>
<StorefrontProductFeaturesAccordionPicture v-bind="props" />
</template>

Props

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

PropTypeDescription
eyebrowstringWordsa short label above the title ("Why this jacket")
title*stringWordsthe section’s title: what makes the product worth it
features*Feature[]3 to 6 features; more are fine, they continue as cards
figuresFigure[]3 or 4 figures, the merchant’s own
closingstringWordsa closing line, a guarantee the merchant really gives
actionsAction[]the buttons under the features, each its words and page action
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Feature features[] · 6 props
PropTypeDescription
title*stringWordsthe selling point in a few words
body*stringWordsone or two sentences, the merchant’s own claim
mediastringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
iconstringDesignshield | leaf | sparkles | ruler | droplets | feather | wrench | heart | zap | package; sparkles when absent
groupstringWordsthe theme it belongs to in the tabs variant ("Material", "Use")
Figure figures[] · 2 props
PropTypeDescription
value*stringWordsa real figure the merchant gave ("2 years", "98%")
label*stringWordswhat it measures
Action actions[] · 3 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 2 props
PropTypeDescription
pictureRatio'landscape' | 'square' | 'portrait'the pictures’ frame (landscape by default)
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
Linkyour router’s link component
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
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: actions[]

A storefront section, for product, landing pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More storefront blocks

  • Product compare swipe: phone-first: columns scroll sideways and snap, the attribute names pinned; chosen automatically beyond four products.
  • Product compare table: two to four models side by side in a plain grid, the current one tinted: the usual comparison of a small range.
  • Product configurator compact: a product page’s buy box with one or two options: a thumbnail, the choices in a row, the total and the button, no second column.
  • Product configurator side by side: a made-to-order page of its own: the picture stays in view on one side while every option runs down the other, the recap at the end.
  • Product dimensions diagram: A dimension drawing with exact measurements, enlarged in a dialog with an all-media tab; the merchant’s own only.
  • Product facets radial: one product with 3 to 6 named facets around its picture: a single object seen from several sides.
  • Product finder inline quiz: a few questions at once as chips on one card, the matching product appearing under the last answer: a short range.
  • Product finder step quiz: one question at a time with picture tiles and a progress bar: a wider range where a need decides the model.

All 409 storefront blocks