Docs
Recipes

Product catalog

Build a browsable catalog with filters, gallery cards, and CSV export.

What you will build

Build a searchable catalog, then switch between rows and image cards without losing the query.

Start with the React setup or Vue setup. Use the complete files below with the shared recipe modules. The browser-memory store resets on reload; an API integration must preserve the same contracts.

Required files: shared/products.ts, product-config.ts, list-records.ts, product-actions.ts, catalog-config.ts, recipe-catalog.

Use the read-only quick-start actions. This recipe adds one display configuration and an entry component. No mutation store is required.

catalog-config.ts

catalog-config.ts
import { defineTableConfig } from "@/components/ui/yayaw-table/config/helpers";
import { productConfig } from "./product-config";

export const catalogConfig = defineTableConfig({
  ...productConfig,
  table: {
    ...productConfig.table,
    layoutPreset: "catalog",
    displayModes: ["table", "gallery"],
    defaultDisplayMode: "gallery",
    export: true,
    enableColumnFilters: true,
    enableAdvancedFilters: true,
    showFilterBar: true,
    filterBarColumns: ["status"],
    coloredTags: false,
    gallery: {
      imageColumn: "image",
      titleColumn: "name",
      cardColumnIds: ["price", "stock", "status"],
      aspectRatio: "square",
      imageFit: "cover",
      cardSize: "medium",
      previewSize: "medium",
      showCardLabels: false,
      media: { enabled: true },
    },
  },
});
catalog-config.ts
import { defineTableConfig } from "@/components/ui/yayaw-table-vue/config";
import { productConfig } from "./product-config";

export const catalogConfig = defineTableConfig({
  ...productConfig,
  table: {
    ...productConfig.table,
    layoutPreset: "catalog",
    displayModes: ["table", "gallery"],
    defaultDisplayMode: "gallery",
    export: true,
    enableColumnFilters: true,
    enableAdvancedFilters: true,
    showFilterBar: true,
    filterBarColumns: ["status"],
    coloredTags: false,
    gallery: {
      imageColumn: "image",
      titleColumn: "name",
      cardColumnIds: ["price", "stock", "status"],
      aspectRatio: "square",
      imageFit: "cover",
      cardSize: "medium",
      previewSize: "medium",
      showCardLabels: false,
      media: { enabled: true },
    },
  },
});

Entry component

Expand ↗

Sample data. Changes stay in this preview.

Expand ↗

Sample data. Changes stay in this preview.

Verify the result

  1. Open the gallery: Oak desk, Desk lamp and Studio chair appear.

  2. Filter Status to Active: two products remain.

  3. Search “desk”: only Oak desk remains.

  4. Switch to Table: the filter still applies.

  5. Export: the CSV contains the filtered product values.

  6. Clear the filters and export again: all three records are included.

Use the existing playground to explore the library’s controls.

Walk through the result

ActionExpected result
Search for 65.Only Desk lamp remains: search includes numeric fields.
Filter Status to Active, then search desk.Only Oak desk remains; the result count is one.
Switch from Gallery to Table.The same filtered records appear.
Clear search and filters, then export CSV.All three products are exported, with their raw typed values.

On mobile, use View settings for presentation, the Data menu for export, and the search button in the toolbar. Resetting a view does not undo writes. Try the keyboard as well as pointer input.