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

Terminal
npx airflib@latest add card-browse

Usage

TSX
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.

NameTypeDefaultDescription
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.
loopbooleantrueA swiped card goes to the back of the deck instead of being thrown out.
storiesbooleantrueThe card in the middle of the row plays its photos (its image, then its stories) like stories.
contentbooleantrueEach card's title and line, and in the row its button; off, cards are photos alone.
layout"deck" | "isometric""deck"The deck's geometry.
angleXnumber-14°Isometric pitch (rotateX, deg). From -60 to 60°.
angleYnumber-30°Isometric yaw (rotateY, deg). From -60 to 60°.
radiusnumber32pxCorner 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.