Skip to content

👾 Fully typesafe React hook for managing pinned items in large lists. Supports pin/unpin, reordering, pin limits, and seamless integration with virtualization and drag-and-drop libraries. Perfect for any UI where users need to prioritize items.

Notifications You must be signed in to change notification settings

ebadyz/react-use-pin-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-use-pin-list

Getting Started

usePinList is a high-performance, fully-typed React hook for managing pinned items in large lists. The bundle size is under 1KB gzipped. It can be seamlessly integrated with TanStack Virtual for virtualized lists and hello-pangea/dnd for drag-and-drop reordering.

  • React version required: react and react-dom >=16.8.0 (Hooks support and compatibility)

Supported Feature Set

  • Pin, unpin, and toggle pin state for any item
  • Reorder pinned items (with optional drag-and-drop integration)
  • Limit the maximum number of pinned items
  • Efficient for very large lists
  • TypeScript support with full type definitions
  • No built-in storage dependencies (bring your own persistence)
  • Customizable callbacks for pin state changes
  • Memory-efficient state management (uses Set/Map internally)
  • Works with virtualization libraries (e.g., TanStack Virtual)
  • Works with drag-and-drop libraries (e.g., hello-pangea/dnd)
  • Zero dependencies, minimal bundle size

Documentation

For API details, usage patterns, and integration examples, see the relevant markdown files above.


MIT License

About

👾 Fully typesafe React hook for managing pinned items in large lists. Supports pin/unpin, reordering, pin limits, and seamless integration with virtualization and drag-and-drop libraries. Perfect for any UI where users need to prioritize items.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published