Category index ladder — Storefront block

Pro

storefront-category-index-ladder · for home, catalog pages

Category index ladder

Categories that differ on one measure (capacity, size, price band): a bar per row, proportional to the real value

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-index-ladder

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontCategoryIndexLadder from '@/components/trame/blocks/storefront/storefront-category-index-ladder.vue'

const props = {
title: "All our departments",
subtitle: "Twenty families of garden tools, sorted from A to Z.",
entries: [
{
id: 1,
name: "Brass and zinc",
count: 2
},
{
id: 2,
name: "Flower boxes",
count: 9
}
],
note: "Number of models on sale as of the last catalog update.",
open: "category",
options: {
unit: "models"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s title ("All our departments")
subtitlestringWordsone sentence under the title, if it helps
entries*Entry[]Datathe categories to list, with their count and, for the ladder, one measured value
notestringWordshow the numbers are computed or what they cover, written under the block
openstringActionthe page action a category opens; it receives the category
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Entry entries[] · 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
valuenumberthe measure on the ladder’s axis (litres, centimetres, euros…), measured from the catalogue
unitstringDesignthe unit written after the value ("L", "cm")
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
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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: open
  • Reads categories from your app

A storefront section, for home, catalog pages.

More storefront blocks

  • Catalog top bar: a bar of facet menus above a full-width grid: for catalogues with two to five facets, where the pictures should have all the room.
  • Category campaign banner in grid: four or five tiles and the merchant’s own announcement tile in the last cell: a campaign among categories.
  • Category comparison compare table: three or four categories against the same specifications: a technical catalogue where the choice is a comparison.
  • Category leaders: two to six categories with their lead product in a row: a way in by what each rayon is known for.
  • Category photo grid direction reveal: photographic tiles whose brand veil slides in from the side the pointer enters by, caption always readable: a catalogue of 4 to 12 categories that all have pictures.
  • Category photo grid lead and two: one tall lead tile beside two stacked: when exactly one category is the one to push.
  • Category photo grid: tiles of one size, 1 to 12 categories with pictures: the plain way into a catalogue.
  • Category tabs accordion: stacked panels, one per category, the first open: fits phones and long category names best.

All 409 storefront blocks