Pinned List

Items that move between pinned and unpinned groups as the same node.

pinned-list.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/pinned-list.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/pinned-list.json

3

Turn on the motion

npx @prequelui/cli@latest animate pinned-list

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

pinned-list.tsx
import { PinnedList } from "@/components/prequelui/pinned-list";

export default function Demo() {
  return (
    <PinnedList
      defaultItems={[
        { id: "aurora", label: "Aurora", pinned: true },
        { id: "atlas", label: "Atlas", pinned: true },
        { id: "beacon", label: "Beacon", pinned: false },
      ]}
    />
  );
}
import { PinnedList } from "@/components/prequelui/pinned-list";

export function Variant() {
  return (
    <PinnedList tempo={1.2}>
      …
    </PinnedList>
  );
}

Animation

An item is not removed and recreated when it changes group: it is the same node moving to a new parent. Motion interpolates its position and size, so the row travels between the two lists in one continuous gesture.

  • Move spring: 320 / 25 with mass 0.8.
  • `layoutId` is shared across the two groups to keep the node identity.
  • The pin icon fades and scales in 220 ms on the soft curve.
  • The moving row is raised to z-index 10 while it travels.
  • Reduced motion reorders the rows without interpolation.
spring 320 / 25mass 0.8layoutIdz-index 10

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

PinnedList

PropTypeDefault
itemsPinnedItem[]—
defaultItemsPinnedItem[]four demo items
onItemsChange(items: PinnedItem[]) => void—
pinnedLabelstring"Pinned"
unpinnedLabelstring"Everything else"
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026