Category tiles portrait rail — Storefront block

Free

storefront-category-tiles-portrait-rail · for home, catalog pages

Category tiles portrait rail

Tall portrait tiles in a scrolling rail with their count and lowest price: a wide catalogue of 6 to 12 rayons

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-category-tiles-portrait-rail

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontCategoryTilesPortraitRail from '@/components/trame/blocks/storefront/storefront-category-tiles-portrait-rail.vue'

const props = {
title: "Shop by department",
subtitle: "Six departments to gear up for a trip, from the jacket to the campsite.",
tiles: [
{
id: "1",
name: "Jackets",
summary: "Windbreakers, puffers and rain jackets for every season.",
image: "https://images.unsplash.com/photo-1673712060934-34358642511b?w=1600&q=80",
alt: "Jackets, category preview",
count: 38,
priceFrom: 8900
},
{
id: "2",
name: "Shoes",
summary: "From Sunday strolls to mountain running.",
image: "https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80",
alt: "Shoes, category preview",
count: 24,
priceFrom: 6500
}
],
open: "category",
allAction: "catalog",
options: {
unit: "models"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s title ("Shop by department")
subtitlestringWordsone sentence under the title, if it helps
tiles*Tile[]Datathe categories (or materials, occasions, recipients) to show, in the order to show them
openstringActionthe page action a tile opens; it receives the category
allActionstringActionthe page action of the "see all" link
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Tile tiles[] · 8 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe category’s name
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the category’s picture shows
countnumberhow many products it holds
summarystringWordsone short line on the category
badgestringWordsa short tag the merchant set ("New"), only when it is true
priceFromnumberthe lowest price of the category in cents, computed from the catalogue
Options options · 2 props
PropTypeDescription
unitstringWordswhat a count counts ("models", "pieces"), written after the number
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
moneyformats a price, given in cents
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
  • Expressive motion, within its budget; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: open, allAction
  • Reads categories from your app

A storefront section, for home, catalog pages; it uses @lucide/vue, @vueuse/core, clsx, motion, tailwind-merge.

Built with

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

More storefront blocks

  • Category tabs accordion: stacked panels, one per category, the first open: fits phones and long category names best.
  • Category tabs sidebar: the categories as a column of large names held on the left, the chosen one’s products, rule and "see all" on the right: four to twelve categories on a wide screen, a department-store feel.
  • Category tabs: two to eight categories previewed in one place: a tab row over a few products, the rule and the "see all" link under them.
  • Checkout extras gift: An optional gift message with the exact changes offered by the merchant.
  • Checkout extras note: A full-width delivery note with its character limit, inside the host checkout form.
  • Checkout narrow sheet: a calm, focused checkout with a few items: one centred column at every width, a summary bar that opens the lines, contact, delivery and payment stacked, one pay button.
  • Checkout one page: a short cart: contact, delivery and payment stacked in one form beside a sticky summary.
  • Checkout returning: a signed-in customer with a saved address and card: one card of rows, each editable alone, then one pay button.

All 409 storefront blocks