ExpandList

Click a row and it rises and opens into a detail card while the others sink away. Cards.

Open playground

About

ExpandList is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ExpandList } from "@ashutoshswamy/smoui" and set items.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ExpandList } from "@ashutoshswamy/smoui";

<ExpandList
  items={[
    { id: "a", title: "Atlas House", subtitle: "Lisbon, 4 nights", meta: "$820", detail: "A quiet stone house.", chips: ["2 beds"], action: "Book stay", image: "/atlas.jpg" },
  ]}
/>

Props 1

items

Rows. Without image, a mesh cover is generated from the title.

{ id; title; subtitle?; meta?; detail; chips?; action?; onAction?; image?; palette? }[]