Skip to content
react-wrapped

List scene

The list scene ranks a few things under a headline. Every row has its rank, its name, a meter measured against the first row, and a count. Use it for a top three: repositories, customers, songs, pages.

Where it happened

Your toprepositories.

01
ada/orbit-cli
TypeScript0 commits
02
ada/telemetry
Go0 commits
03
ada/dotfiles
Shell0 commits

Three rows, each measured against the first.

Installation

bash
pnpm add @react-wrapped/scenes @react-wrapped/core gsap

Usage

Call listScene with what the scene says, then with the key and the label it goes by. What comes back is a scene placed in a video: put it in the scenes array of a player. The code below places the scene in the preview above.

tsx
import { listScene } from "@react-wrapped/scenes";

export const scene = listScene(
  {
    eyebrow: "Where it happened",
    title: ["Your top", "repositories."],
    items: [
      {
        name: "ada/orbit-cli",
        value: 742,
        unit: "commits",
        meta: "TypeScript",
        color: "#3178c6",
      },
      { name: "ada/telemetry", value: 355, unit: "commits", meta: "Go", color: "#00add8" },
      { name: "ada/dotfiles", value: 203, unit: "commits", meta: "Shell", color: "#89e051" },
    ],
  },
  { key: "repositories", label: "Top repositories" },
);

Props

PropTypeWhat it does
eyebrowstringThe small line above the headline.
titlereadonly string[]The headline, one entry per line.
itemsreadonly { name: string; value: number; unit: string; meta?: string; color?: string | null }[]The rows, biggest first. value and unit are the count on the right, meta is the small note on the left, and color puts a dot before it.

What a viewer can rewrite

These texts are the scene's fields. From the pencil on the timeline a viewer opens the scene editor and rewrites them. Numbers, charts and pictures stay yours. Place the scene with locked: true and it offers none of them.

FieldIn the editorEdited as
eyebrowLine aboveOne line
titleHeadlineLines, one per line on screen

How it comes in

The rows slide in from one side, a beat apart (the seed picks the side). Each row's meter then draws from the left while its count climbs. The scene then holds for at least as long as its text takes to read. The way out is not the scene's: the player adds a transition.

In a real year

The sample lists the three repositories with the most commits and tags each with its main language.

Your home turf

Your toprepositories.

01
orbit/landing
TypeScript0 commits
02
ada/dotfiles
Python0 commits
03
ada/star-chart
Rust0 commits

Last updated . Read this page as Markdown.