X Enterprises
nuxt-x-affiliate

Content Index

Listing-page section composing XAFContentCard grids or lists — hero header, empty state, and optional "View all" link for /reviews and /articles indexes.

Content Index

The XAFContentIndex component is the listing-page workhorse — pass it an array of items and it renders a responsive XAFContentCard grid (or list) with an optional hero header, an empty state, and a "View all" link. It powers /reviews, /articles, category indexes, and sidebar / footer "Worth reading" sections from one component.

Components

<XAFContentIndex />

<XAFContentIndex
  title="Latest reviews"
  subtitle="Every product we've tested, ranked and scored."
  collection="reviews"
  hero
  :columns="3"
  view-all-href="/reviews"
  :items="[
    {
      kind: 'review',
      title: 'Logitech MX Keys S review',
      href: '/reviews/mx-keys-s',
      category: 'Logitech',
      rating: 4.6,
      price: 99.99,
      image: '/covers/mx-keys-s.webp',
      description: 'The best low-profile wireless keyboard for typists.',
    },
    {
      kind: 'article',
      title: 'How we test mechanical keyboards',
      href: '/articles/how-we-test-keyboards',
      date: '2026-01-15',
      description: 'A behind-the-scenes look at our testing methodology.',
    },
  ]"
/>

Props

PropTypeDefaultDescription
itemsContentIndexItem[]requiredContent items to render (see below).
titlestringSection / page title.
subtitlestringSubtitle shown under the title (hero mode).
collectionstringSemantic collection name (e.g. 'reviews'). Used for the aria-label.
herobooleanfalseRender a prominent <h1> hero header (index pages) instead of the inline <h2> header (sidebars / footers).
columns2 | 3 | 43Grid columns at full width.
layout'grid' | 'list''grid'Layout mode.
emptyMessagestring'Nothing here yet.'Empty-state message.
showEmptybooleantrueShow the empty state when items is empty.
viewAllHrefstringOptional "View all" link target.
viewAllLabelstring'View all'"View all" link label.

ContentIndexItem

Each item is forwarded to XAFContentCard via v-bind, so every card prop is supported:

FieldTypeDescription
titlestringPage title (review name or article title). Required.
hrefstringTarget URL. Required.
kind'review' | 'article'Card variant — controls top-row content, price line, title size. Required.
categorystringBrand name (reviews) or category (articles).
ratingnumberStar rating 0–5 (reviews only).
pricenumberBuild-time-captured price (reviews).
datestringISO YYYY-MM-DD publish date (articles).
metastringSecondary meta line.
descriptionstringShort excerpt / teaser.
ctaLabelstringCTA text.
image / imageAltstringOptional cover image + alt text.
imageAspect'video' | 'square' | 'auto'Aspect-ratio mode for the cover image.
imageLoading'lazy' | 'eager'Loading strategy — pass 'eager' for the first 1–3 cards so the LCP image isn't deferred.
imageWidth / imageHeightnumber | stringExplicit dimensions (reserves layout space, prevents CLS).

AI Context

component: XAFContentIndex
package: "@xenterprises/nuxt-x-affiliate"
use-when: Listing pages (/reviews, /articles, category indexes) and sidebar/footer card sections — composes XAFContentCard into a grid or list with hero header, empty state, and "View all" link.
Copyright © 2026