Join our Discord community
Interactive

Pin List

Interactive list component with pin/unpin functionality and smooth layout animations. Perfect for React applications requiring organized content management with Next.js integration and TypeScript support.

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/pin-list.json
npx shadcn@latest add https://www.shadcn.io/registry/pin-list.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/pin-list.json
bunx shadcn@latest add https://www.shadcn.io/registry/pin-list.json

Features

  • Pin/unpin functionality with smooth layout transitions using Motion's LayoutGroup
  • Automatic sectioning separating pinned and unpinned items with customizable labels
  • Interactive animations with hover states and z-index management for clean transitions
  • Flexible item structure supporting icons, names, descriptions, and custom metadata
  • TypeScript support with complete interface definitions for items and configuration
  • shadcn/ui compatibility using utility classes and consistent design patterns

Use Cases

This free open source React component works well for:

  • Task management - To-do lists with priority pinning built with Next.js
  • Bookmark organization - Favorite items and general collections using TypeScript and Tailwind CSS
  • Dashboard widgets - Customizable panels with user-defined importance levels
  • Content management - Articles, documents, or media with pinning capabilities

API Reference

PinList

PropTypeDefaultDescription
itemsPinListItem[]requiredArray of items to display with pin states
labels{pinned?: string, unpinned?: string}{pinned: "Pinned Items", unpinned: "All Items"}Section labels for pinned and unpinned groups
transitionTransition{stiffness: 320, damping: 20, mass: 0.8, type: "spring"}Motion transition configuration
labelMotionPropsHTMLMotionProps<'p'>{initial: {opacity: 0}, animate: {opacity: 1}, ...}Animation props for section labels
zIndexResetDelaynumber500Delay before resetting z-index after animations
classNamestring-Additional CSS classes for the container
labelClassNamestring-CSS classes for section labels
pinnedSectionClassNamestring-CSS classes for pinned items section
unpinnedSectionClassNamestring-CSS classes for unpinned items section

PinListItem

PropertyTypeDescription
idnumberUnique identifier for the item
namestringDisplay name or title
infostringSecondary information or description
iconReact.ElementTypeLucide React icon component
pinnedbooleanCurrent pin state of the item

Implementation Notes

  • Uses Motion's LayoutGroup for seamless item transitions between sections
  • Automatic state management with click handlers for pin toggling
  • Z-index coordination prevents animation conflicts during transitions
  • AnimatePresence handles section label appearance/disappearance
  • Items automatically reorder when pin state changes
  • Compatible with shadcn/ui theming and responsive layouts