Card browse
Too many offers for too little room? A deck shows one at a time and makes choosing quick. Open a card for details or a choice inside it. Loop or knock-out, flat or 3D isometric, switched on the fly. Works on mobile and desktop.
Install
npx airflib@latest add card-browse
Usage
import { CardBrowse } from "@/components/airflib/components/card-browse";
<CardBrowse
expand="tap"
loop={true}
stories={true}
content={true}
layout="deck"
radius={32}
/>
API
Its main settings, read from the code: each prop's type and default. The prompt lists every prop.
| Name | Type | Default | Description |
|---|---|---|---|
expand | "tap" | "always" | "never" | "tap" | How it expands: tap opens the front card into a row of its own cards, always stands open as a row of items, never stays a folded deck. |
loop | boolean | true | A swiped card goes to the back of the deck instead of being thrown out. |
stories | boolean | true | The card in the middle of the row plays its photos (its image, then its stories) like stories. |
content | boolean | true | Each card's title and line, and in the row its button; off, cards are photos alone. |
layout | "deck" | "isometric" | "deck" | The deck's geometry. |
angleX | number | -14° | Isometric pitch (rotateX, deg). From -60 to 60°. |
angleY | number | -30° | Isometric yaw (rotateY, deg). From -60 to 60°. |
radius | number | 32px | Corner radius of every card, in pixels. Inside a flow, the flow's radius applies until this is set. From 0 to 60px. |
Sound
The sounds in the catalog are the site's. The block comes silent, with a place for your own.