react-beautiful-dnd vs react-dnd vs react-sortable-hoc
ドラッグアンドドロップライブラリ
react-beautiful-dndreact-dndreact-sortable-hoc

ドラッグアンドドロップライブラリ

ドラッグアンドドロップライブラリは、ユーザーインターフェースにおいて要素をドラッグして移動させる機能を提供するためのツールです。これにより、ユーザーは直感的にアイテムを移動したり、並べ替えたりすることができ、インタラクティブな体験を提供します。これらのライブラリは、Reactアプリケーションにおいて、複雑なドラッグアンドドロップのロジックを簡素化し、開発者が効率的に機能を実装できるようにします。

npmのダウンロードトレンド

3 年

GitHub Starsランキング

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
react-beautiful-dnd034,0021.39 MB642-Apache-2.0
react-dnd021,635231 kB474-MIT
react-sortable-hoc010,892-2915年前MIT

機能比較: react-beautiful-dnd vs react-dnd vs react-sortable-hoc

使いやすさ

  • react-beautiful-dnd:

    react-beautiful-dndは、シンプルで直感的なAPIを提供しており、初心者でも簡単に導入できます。基本的なドラッグアンドドロップの機能をすぐに実装できるため、迅速な開発が可能です。

  • react-dnd:

    react-dndは、柔軟性が高い反面、設定がやや複雑です。カスタムのドラッグソースやドロップターゲットを定義する必要があるため、学習曲線がやや急です。

  • react-sortable-hoc:

    react-sortable-hocは、リストの並べ替えに特化しており、簡単に使えるAPIを提供します。特に、リストアイテムの並べ替えを行う場合には、非常に使いやすいです。

パフォーマンス

  • react-beautiful-dnd:

    react-beautiful-dndは、アニメーションとスタイルの最適化が施されており、パフォーマンスが良好です。特に、リストのアイテムが多い場合でもスムーズな操作が可能です。

  • react-dnd:

    react-dndは、複雑なドラッグアンドドロップのシナリオに対応できるため、パフォーマンスが高いですが、設定が複雑になることがあります。最適化には注意が必要です。

  • react-sortable-hoc:

    react-sortable-hocは、軽量で高速なパフォーマンスを提供します。特に、リストアイテムの並べ替えに特化しているため、効率的に動作します。

カスタマイズ性

  • react-beautiful-dnd:

    react-beautiful-dndは、スタイルやアニメーションのカスタマイズが容易で、独自のデザインに合わせやすいです。

  • react-dnd:

    react-dndは、非常に高いカスタマイズ性を持ち、複雑な要件に対応できますが、その分設定が複雑です。

  • react-sortable-hoc:

    react-sortable-hocは、シンプルなAPIを持ちながらも、基本的なカスタマイズが可能です。特に、リストの並べ替えに特化しているため、特定の要件に合わせやすいです。

ドキュメントとサポート

  • react-beautiful-dnd:

    react-beautiful-dndは、充実したドキュメントがあり、サンプルコードも豊富です。初心者でも理解しやすい内容になっています。

  • react-dnd:

    react-dndは、ドキュメントが詳細で、複雑な機能に関する情報も豊富ですが、初心者には少し難しいかもしれません。

  • react-sortable-hoc:

    react-sortable-hocは、シンプルなライブラリであるため、ドキュメントも簡潔で理解しやすいです。特に、リストの並べ替えに関する情報が明確です。

コミュニティとエコシステム

  • react-beautiful-dnd:

    react-beautiful-dndは、活発なコミュニティがあり、多くのサポートや拡張機能が存在します。

  • react-dnd:

    react-dndは、広範なエコシステムを持ち、さまざまなプラグインや拡張機能が利用可能です。

  • react-sortable-hoc:

    react-sortable-hocは、比較的新しいライブラリですが、シンプルさから人気があり、サポートも得やすいです。

選び方: react-beautiful-dnd vs react-dnd vs react-sortable-hoc

  • react-beautiful-dnd:

    react-beautiful-dndは、シンプルで使いやすいAPIを提供し、視覚的に美しいドラッグアンドドロップ体験を実現します。特に、リストやグリッドの並べ替えが必要な場合に適しています。アニメーションやスタイルのカスタマイズが容易で、迅速な開発を求める場合に最適です。

  • react-dnd:

    react-dndは、より柔軟で強力なドラッグアンドドロップ機能を提供します。複雑なドラッグアンドドロップのシナリオや、カスタムのドラッグソースやドロップターゲットが必要な場合に適しています。高度な機能を必要とするプロジェクトに向いています。

  • react-sortable-hoc:

    react-sortable-hocは、リストの並べ替えに特化したライブラリで、シンプルなAPIを提供します。特に、リストアイテムの並べ替えが主な機能である場合に選択するのが良いでしょう。軽量で、簡単に導入できるため、迅速な開発が可能です。

react-beautiful-dnd のREADME

⚠️ Maintenance & support

This library continues to be relied upon heavily by Atlassian products, but we are focused on other priorities right now and have no current plans for further feature development or improvements.

It will continue to be here on GitHub and we will still make critical updates (e.g. security fixes, if any) as required, but will not be actively monitoring or replying to issues and pull requests.

We recommend that you don’t raise issues or pull requests, as they will not be reviewed or actioned until further notice.


react beautiful dnd logo

react-beautiful-dnd (rbd)

Beautiful and accessible drag and drop for lists with React

CircleCI branch npm

quote application example

Play with this example if you want!

Core characteristics

  • Beautiful and natural movement of items 💐
  • Accessible: powerful keyboard and screen reader support ♿️
  • Extremely performant 🚀
  • Clean and powerful api which is simple to get started with
  • Plays extremely well with standard browser interactions
  • Unopinionated styling
  • No creation of additional wrapper dom nodes - flexbox and focus management friendly!

Get started 👩‍🏫

We have created a free course on egghead.io 🥚 to help you get started with react-beautiful-dnd as quickly as possible.

course-logo

Currently supported feature set ✅

  • Vertical lists ↕
  • Horizontal lists ↔
  • Movement between lists (▤ ↔ ▤)
  • Virtual list support 👾 - unlocking 10,000 items @ 60fps
  • Combining items
  • Mouse 🐭, keyboard 🎹♿️ and touch 👉📱 (mobile, tablet and so on) support
  • Multi drag support
  • Incredible screen reader support ♿️ - we provide an amazing experience for english screen readers out of the box 📦. We also provide complete customisation control and internationalisation support for those who need it 💖
  • Conditional dragging and conditional dropping
  • Multiple independent lists on the one page
  • Flexible item sizes - the draggable items can have different heights (vertical lists) or widths (horizontal lists)
  • Add and remove items during a drag
  • Compatible with semantic <table> reordering - table pattern
  • Auto scrolling - automatically scroll containers and the window as required during a drag (even with keyboard 🔥)
  • Custom drag handles - you can drag a whole item by just a part of it
  • Able to move the dragging item to another element while dragging (clone, portal) - Reparenting your <Draggable />
  • Create scripted drag and drop experiences 🎮
  • Allows extensions to support for any input type you like 🕹
  • 🌲 Tree support through the @atlaskit/tree package
  • A <Droppable /> list can be a scroll container (without a scrollable parent) or be the child of a scroll container (that also does not have a scrollable parent)
  • Independent nested lists - a list can be a child of another list, but you cannot drag items from the parent list into a child list
  • Server side rendering (SSR) compatible - see resetServerContext()
  • Plays well with nested interactive elements by default

Motivation 🤔

react-beautiful-dnd exists to create beautiful drag and drop for lists that anyone can use - even people who cannot see. For a good overview of the history and motivations of the project you can take a look at these external resources:

Not for everyone ✌️

There are a lot of libraries out there that allow for drag and drop interactions within React. Most notable of these is the amazing react-dnd. It does an incredible job at providing a great set of drag and drop primitives which work especially well with the wildly inconsistent html5 drag and drop feature. react-beautiful-dnd is a higher level abstraction specifically built for lists (vertical, horizontal, movement between lists, nested lists and so on). Within that subset of functionality react-beautiful-dnd offers a powerful, natural and beautiful drag and drop experience. However, it does not provide the breadth of functionality offered by react-dnd. So react-beautiful-dnd might not be for you depending on what your use case is.

Documentation 📖

About 👋

Sensors 🔉

The ways in which somebody can start and control a drag

API 🏋️‍

diagram

Guides 🗺

Patterns 👷‍

Support 👩‍⚕️

Read this in other languages 🌎

Creator ✍️

Alex Reardon @alexandereardon

Alex is no longer personally maintaning this project. The other wonderful maintainers are carrying this project forward.

Maintainers

Collaborators 🤝