SwipeList

A message list you clear by swiping. Right archives, left deletes; the gap closes behind, and an undo pill brings the last one back. Data.

Open playground
  • Mira Chen
    Can we ship the dialog on Friday?
    9:41
  • Jon Park
    Reduced motion pass is done
    9:12
  • Ada Okafor
    New springs look great
    Yesterday
  • Lee Wong
    Invoice for March attached
    Mon

About

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

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

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

<SwipeList items={[{ id: "1", title: "Mira Chen", subtitle: "Can we ship Friday?", time: "9:41" }]} onAction={(id, action) => sync(id, action)} />

Props 2

items

Rows. Each gets a mesh avatar from its title.

{ id; title; subtitle?; time? }[]
onAction

Called when a row is cleared. Keys: E archives, Delete removes.

(id, "archive" | "delete") => void