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

@editora/ui-sortable

v0.1.1

Published

Standalone install for the Editora sortable web component, with reordering, transfer, hierarchy, cloning, and keyboard-accessible drag and drop.

Readme

@editora/ui-sortable

[!IMPORTANT] Broader docs and examples: https://editora-ecosystem.netlify.app/docs/ui-react/interactive/sortable

Standalone package for the Editora sortable web component.

@editora/ui-sortable is the smallest way to ship <ui-sortable> without importing the full @editora/ui-core catalog. It supports:

  • single-list reordering
  • multi-list transfer
  • nesting and hierarchy
  • multi-selection
  • keyboard-accessible drag and drop
  • indicator or container-style dropzones
  • an optional React wrapper via @editora/ui-sortable/react

Installation

npm install @editora/ui-sortable

If you want the React wrapper entry, also install React peer dependencies:

npm install react react-dom

Or install the standalone React-ready setup in one step:

npm install @editora/ui-sortable react react-dom

Quick Start

Import the package once to register the custom element:

import '@editora/ui-sortable';

Then bind lists and items:

import '@editora/ui-sortable';

const sortable = document.querySelector('ui-sortable');

sortable.lists = [
  { id: 'backlog', label: 'Backlog' },
  { id: 'in-progress', label: 'In Progress' },
  { id: 'done', label: 'Done' }
];

sortable.items = [
  { id: 'story-1', label: 'Audit onboarding', listId: 'backlog' },
  { id: 'story-2', label: 'Ship release notes', listId: 'in-progress' },
  { id: 'story-3', label: 'Review handoff', listId: 'done' }
];
<ui-sortable></ui-sortable>

React Wrapper

The package also exposes a standalone React wrapper:

import { Sortable, type SortableItem, type SortableList } from '@editora/ui-sortable/react';

const lists: SortableList[] = [
  { id: 'backlog', label: 'Backlog' },
  { id: 'done', label: 'Done' }
];

const items: SortableItem[] = [
  { id: 'story-1', label: 'Audit onboarding', listId: 'backlog' },
  { id: 'story-2', label: 'Ship release notes', listId: 'done' }
];

export function Example() {
  return (
    <Sortable
      lists={lists}
      items={items}
      dropzoneStyle="container"
      onChange={(detail) => {
        console.log(detail.items);
      }}
    />
  );
}

Use @editora/ui-sortable/react when you want the sortable wrapper only, without taking the rest of @editora/ui-react.

If you are using Next.js, App Router, or another SSR/RSC framework, import @editora/ui-sortable/react from a client component because it registers the custom element in the browser runtime.

'use client';

import { Sortable } from '@editora/ui-sortable/react';

React Examples

Controlled Board

import * as React from 'react';
import { Sortable, type SortableItem, type SortableList } from '@editora/ui-sortable/react';

const lists: SortableList[] = [
  { id: 'templates', label: 'Templates', cloneOnDrag: true },
  { id: 'backlog', label: 'Backlog' },
  { id: 'active', label: 'In Progress' },
  { id: 'done', label: 'Done', orientation: 'horizontal' }
];

const initialItems: SortableItem[] = [
  { id: 'template-brief', label: 'Launch brief template', listId: 'templates', cloneOnDrag: true },
  { id: 'epic', label: 'Release epic', listId: 'backlog' },
  { id: 'brief', label: 'Draft launch brief', listId: 'backlog', parentId: 'epic' },
  { id: 'review', label: 'Design review', listId: 'active' }
];

export function ReleaseBoard() {
  const [items, setItems] = React.useState(initialItems);
  const [selection, setSelection] = React.useState<string[]>(['epic']);

  return (
    <Sortable
      lists={lists}
      items={items}
      selection={selection}
      persistKey="release-board"
      onItemsChange={setItems}
      onSelectionChange={(detail) => setSelection(detail.selection)}
      onPersistRequest={(detail) => {
        console.log(detail.persistence.records);
      }}
    />
  );
}

Flat List Sorting

import * as React from 'react';
import { Sortable, type SortableItem, type SortableList } from '@editora/ui-sortable/react';

const lists: SortableList[] = [
  { id: 'queue', label: 'Editorial Queue' }
];

const initialItems: SortableItem[] = [
  { id: 'headline', label: 'Headline polish', listId: 'queue' },
  { id: 'legal', label: 'Legal review', listId: 'queue' },
  { id: 'seo', label: 'SEO metadata', listId: 'queue' }
];

export function FlatSortableQueue() {
  const [items, setItems] = React.useState(initialItems);

  return (
    <Sortable
      lists={lists}
      items={items}
      allowNesting={false}
      onItemsChange={setItems}
    />
  );
}

Clone Library

import { Sortable, type SortableItem, type SortableList } from '@editora/ui-sortable/react';

const lists: SortableList[] = [
  { id: 'library', label: 'Template Library', cloneOnDrag: true },
  { id: 'campaign', label: 'Campaign Plan' }
];

const items: SortableItem[] = [
  { id: 'press-kit', label: 'Press kit template', listId: 'library', cloneOnDrag: true },
  { id: 'email-series', label: 'Lifecycle email series', listId: 'library', cloneOnDrag: true },
  { id: 'owner-sync', label: 'Owner sync', listId: 'campaign' }
];

export function CloneLibraryExample() {
  return <Sortable lists={lists} items={items} />;
}

Container Dropzones

<Sortable
  lists={lists}
  items={items}
  dropzoneStyle="container"
/>

Custom Item Rendering

<Sortable
  lists={lists}
  items={items}
  selection={selection}
  onItemsChange={setItems}
  renderItem={(item, context) => (
    <div style={{ display: 'grid', gap: 8 }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', gap: 12 }}>
        <strong>{item.label}</strong>
        <span>{context.selected ? 'Selected' : 'Ready'}</span>
      </div>
      {item.description && <div>{item.description}</div>}
      <small>{context.list?.label}</small>
    </div>
  )}
/>

Custom List Headers And Empty States

<Sortable
  lists={lists}
  items={items}
  renderListHeader={(list, context) => (
    <div style={{ display: 'flex', justifyContent: 'space-between', gap: 12 }}>
      <strong>{list.label}</strong>
      <span>{context.itemCount} items</span>
    </div>
  )}
  renderEmptyState={(list) => (
    <div>
      No items in {list.label} yet. Drag something here to get started.
    </div>
  )}
/>

Nested Hierarchy

import { Sortable, type SortableItem, type SortableList } from '@editora/ui-sortable/react';

const lists: SortableList[] = [
  { id: 'roadmap', label: 'Roadmap' }
];

const items: SortableItem[] = [
  { id: 'initiative', label: 'Reader retention initiative', listId: 'roadmap' },
  { id: 'survey', label: 'Audience survey', listId: 'roadmap', parentId: 'initiative' },
  { id: 'experiment', label: 'Paywall experiment', listId: 'roadmap' }
];

export function NestedHierarchyExample() {
  return <Sortable lists={lists} items={items} />;
}

For broader usage patterns, Storybook-style variations, and the full prop reference, use the Editora docs:

  • https://editora-ecosystem.netlify.app/docs/ui-react/interactive/sortable

Dropzone Styles

Use the default insertion rails:

<ui-sortable></ui-sortable>

Or switch to container-style dropzones:

<ui-sortable dropzone-style="container"></ui-sortable>

Common Attributes

  • dropzone-style="indicator|container"
  • drop-indicator-visibility="active|always"
  • drag-preview-size="match-item|compact"
  • drag-handle-mode="handle|item"
  • allow-nesting
  • persist-key

Events

The component emits CustomEvents such as:

  • change
  • selection-change

Each event provides structured detail payloads for the latest ordering or selection state.

Type Exports

The package also re-exports sortable types from @editora/ui-core/sortable, including:

  • UISortable
  • UISortableList
  • UISortableItem
  • UISortableChangeDetail
  • UISortableDropzoneStyle

The React subpath exports:

  • Sortable
  • SortableList
  • SortableItem
  • SortableChangeDetail
  • SortableDropzoneStyle

Development

cd packages/ui-sortable
npm run build
npm run test