npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gridui/sortable

v1.1.5

Published

GridUI React sortable

Readme

@gridui/sortable

Core family. Public API: Sortable, SortableAnnouncement, SortableEntry, SortableHandle, SortableHandleProps, SortableItem, SortableItemProps, SortableMessages, SortableMoveButton, SortableMoveButtonProps, SortableProps.

Import components from @gridui/sortable and load @gridui/sortable/styles.css after Theme. Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.

See component ownership and release history.

Sortable collections

Sortable, SortableItem, and SortableHandle wrap the current @dnd-kit/react API. Sortable owns pointer, touch, and keyboard interaction, drag feedback, focus restoration, and localized accessibility announcements. Consumers own the ordered records and commit changes through onMove(sourceIndex, targetIndex).

Pass items with stable, unique string or numeric IDs and human-readable labels. Supply localized messages.instructions, messages.roleDescription, and an announce function for the start, move, end, and cancel phases. Announcements receive the item label, one-based position, and collection count. Internal IDs are never used as spoken labels.

Each SortableItem receives its ID and zero-based index. It renders a div by default; render={<li />} preserves an ordered list. Native props and refs are merged through Radix Slot (or passed to a render callback). Place SortableHandle inside each item with a localized label. In a filled grid, keep GridItem as the direct React child and use GridItem asChild around SortableItem. No extra DOM wrapper is added, so list semantics, direct grid children, and framed seams remain intact. The handle is a themed 2.75rem button. Only the handle suppresses touch scrolling; the remaining content keeps normal scrolling and independent actions. Items expose data-sort-state="idle|dragging|dropping" for feedback and readiness checks. Their default border-box sizing keeps padded drag shapes and keyboard targets aligned even when the consumer does not load a global CSS reset.

Space or Enter picks up and drops an item; arrow keys move through a list or responsive grid; Escape cancels. Pointer and touch use the same dedicated handle. Canceled, disabled, unchanged, or stale operations do not call onMove. Collections with fewer than two items disable sorting. Reordering and drop transitions respect reduced motion. FilePicker retains native external file dropping; collection sorting does not replace file import.

The UI browser fixture verifies pointer, touch, keyboard, cancellation, focus, announcements, disabled states, independent contexts, and responsive grid cells.

Individual disabled or loading handles, including native fieldset disabling, do not start or commit sorting. Disabling the source handle during an operation cancels it. Custom handle classes merge with the default interaction styles.

Move buttons

Place SortableMoveButton inside a SortableItem to move the item one position with a click, tap, or key press. Set direction="previous" or direction="next" and provide an item-specific localized label. The default arrows suit vertical lists. Pass decorative children for other orientations.

The buttons call the same onMove as dragging and announce the new position through messages.announce with phase "end". At either boundary the unavailable button uses aria-disabled so a move to that boundary can retain focus.

Component reference contains focused API pages for each public component.