id-order-spacing

Fast, precise ordering for sortable lists.

id-order-spacing is a small utility for maintaining a stable order field in databases — built for apps where items need to be manually sorted, rearranged, or ranked. Loosely inspired by Jira’s LexoRank system, it lets you insert items between others without reindexing the entire list.


What It Does

  • Stable Ordering via Spaced Values: Instead of using integers (1, 2, 3...), id-order-spacing generates order values like 100, 200, 150, etc. — making it easy to insert new items between existing ones without shifting everything.
  • Drop-In Reordering Logic: Handles edge cases like items moving to the start or end, gaps that are too tight, and optional re-spacing when needed.
  • Designed for Real-World UIs: Perfect for drag-and-drop lists, kanban boards, ranked queues, and any interface where users need to control the position of items.
  • Works with Any Backend: Store order as a number or string in your database. Use it in SQL, NoSQL, Firebase, or wherever your data lives.

“We built this because we wanted simple, robust ordering logic that just works — without needing to constantly reshuffle rows in the database.”
— The Sparkstone Team

View source

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *