Skip to content

Items card

Anything with a title and often a picture — search results, articles, recipes, listings — as a carousel, a list or a grid.

On this page
Open
The items card, as a carousel, in an aparté chat The items card, as a carousel, in an aparté chat

The generic card: one item or up to ten, each a title with a picture, a badge over its corner, a few lines of detail and up to three short facts. The whole tile opens its url in a new tab. One item, in any variant, is one card at full width.

Open

Rows, a thumbnail at the start: for results a person scans rather than browses.

Open

Two columns of tiles.

Open

The skeleton keeps the place of the tiles, under what the search was for.

bash
npm install @aparte/plugin-cards @aparte/core
ts
import { setupItemsCard } from '@aparte/plugin-cards/items';

setupItemsCard({
  tool: 'search_recipes',
  map: (result) => ({
    title: result.heading,
    items: result.hits.map((hit: { name: string; site: string; photo: string; link: string }) => ({
      title: hit.name,
      subtitle: hit.site,
      image: hit.photo,
      url: hit.link,
    })),
  }),
});

An item’s fields, and its buttons (an id your app answers, never a message sent from a tool’s result), are in the guide.