Animate UI

Pinned List

A pin list component that allows you to pin items to the top of the list.

Made by imskyleen
Edit on GitHub

Pinned

Item 2
Item 3

Unpinned

Item 1
Item 4

Installation

Usage

<PinnedList>
  <PinnedListPinned>
    <PinnedListLabel>Pinned</PinnedListLabel>

    <PinnedListItems>
      <PinnedListItem />
      <PinnedListItem customTrigger>
        <PinnedListItemTrigger />
      </PinnedListItem>
    </PinnedListItems>
  </PinnedListPinned>

  <PinnedListUnpinned>
    <PinnedListLabel>Unpinned</PinnedListLabel>

    <PinnedListItems>
      <PinnedListItem />
      <PinnedListItem customTrigger>
        <PinnedListItemTrigger />
      </PinnedListItem>
    </PinnedListItems>
  </PinnedListUnpinned>
</PinnedList>

API Reference

PinnedList

PropTypeDefault
children
React.ReactNode
-
onPinnedChange?
(id: string) => void
-
...props?
HTMLMotionProps<"div">
-

PinnedListPinned

PropTypeDefault
...props?
React.ComponentProps<"div">
-

PinnedListUnpinned

PropTypeDefault
...props?
React.ComponentProps<"div">
-

PinnedListLabel

PropTypeDefault
hide?
boolean
false
transition?
Transition
{ duration: 0.22, ease: "easeInOut" }
asChild?
boolean
false
...props?
HTMLMotionProps<"p">
-

PinnedListItems

PropTypeDefault
...props?
HTMLMotionProps<"div">
-

PinnedListItem

PropTypeDefault
id
string
-
children
React.ReactNode
-
customTrigger?
boolean
false
transition?
Transition
{ stiffness: 320, damping: 25, mass: 0.8, type: "spring" }
asChild?
boolean
false
...props?
HTMLMotionProps<"div">
-

PinnedListItemTrigger

PropTypeDefault
asChild?
boolean
false
...props?
HTMLMotionProps<"button">
-

Credits

Built by Skyleen. The source code is available on GitHub.