Skip to content

Commit 456f61e

Browse files
docs: give the README a proper face
Vaporwave hero from the docs site, working themed badges (the broken sponsors badge is gone, npm badge points at the right package), a fuller description, a minimal React quick-start, and a retro read-the-docs button in the site's style (new SVG asset, also served by the docs site at /img/read-the-docs.svg).
1 parent 2c54088 commit 456f61e

2 files changed

Lines changed: 80 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,59 @@
1-
<img src="https://s3.amazonaws.com/cdn.formk.it/web-assets/drag-and-drop.gif" alt="FormKit Drag & Drop" width="250" height="250">
1+
<p align="center">
2+
<a href="https://drag-and-drop.formkit.com">
3+
<img src="https://drag-and-drop.formkit.com/og.png" alt="FormKit Drag & Drop — a tiny declarative library for modern apps" width="640">
4+
</a>
5+
</p>
26

3-
[![Tests](https://github.com/formkit/drag-and-drop/actions/workflows/ci.yml/badge.svg)](https://github.com/formkit/drag-and-drop/actions/workflows/ci.yml)![GitHub Sponsors](https://img.shields.io/github/sponsors/formkit)
4-
![NPM Version](https://img.shields.io/npm/v/%40formkit%2Fdrag-and-drop)
7+
<p align="center">
8+
<a href="https://github.com/formkit/drag-and-drop/actions/workflows/ci.yml"><img src="https://github.com/formkit/drag-and-drop/actions/workflows/ci.yml/badge.svg" alt="Tests"></a>
9+
<a href="https://www.npmjs.com/package/@formkit/drag-and-drop"><img src="https://img.shields.io/npm/v/%40formkit%2Fdrag-and-drop?color=fe44dc&label=npm" alt="npm version"></a>
10+
<a href="https://bundlephobia.com/package/@formkit/drag-and-drop"><img src="https://img.shields.io/bundlephobia/minzip/%40formkit%2Fdrag-and-drop?color=409baf&label=gzip" alt="gzip size"></a>
11+
<a href="https://github.com/formkit/drag-and-drop/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/%40formkit%2Fdrag-and-drop?color=8b32c9" alt="MIT license"></a>
12+
</p>
513

614
## Introduction
715

8-
FormKit’s Drag and Drop is a small library for adding data-first drag and drop sorting and transferring for lists in your app. It’s simple, flexible, framework agnostic, and clocks in at only ~4Kb gzipped.
16+
FormKit's Drag and Drop is a small library for adding data-first drag and drop sorting and transferring of lists to your app. It's **simple**, **flexible**, **framework agnostic**, and clocks in at only **~4Kb gzipped**.
917

10-
<a href="https://drag-and-drop.formkit.com">
11-
Check out the docs here!
12-
</a>
18+
Data-first means your array is the source of truth: drag an item and your data reorders with it — no DOM spelunking, no sortable-state to sync. It ships with first-class wrappers for **React**, **Vue**, and **Solid**, works in plain **JS/TS**, and has built-in support for multi-drag, animations, insert indicators, drop zones, drag handles, and list-to-list transfers.
19+
20+
## Quick start
21+
22+
```bash
23+
npm install @formkit/drag-and-drop
24+
```
25+
26+
```jsx
27+
import { useDragAndDrop } from "@formkit/drag-and-drop/react";
28+
29+
export function Tapes() {
30+
const [ref, tapes] = useDragAndDrop([
31+
"Depeche Mode",
32+
"Duran Duran",
33+
"Pet Shop Boys",
34+
"Kraftwerk",
35+
]);
36+
37+
return (
38+
<ul ref={ref}>
39+
{tapes.map((tape) => (
40+
<li key={tape}>{tape}</li>
41+
))}
42+
</ul>
43+
);
44+
}
45+
```
46+
47+
That's a fully sortable list — drag the items and `tapes` stays in order. The same API is available for Vue, Solid, and vanilla JS/TS.
48+
49+
<p align="center">
50+
<a href="https://drag-and-drop.formkit.com">
51+
<img src="https://raw.githubusercontent.com/formkit/drag-and-drop/main/docs/public/img/read-the-docs.svg" alt="Read the docs" width="300">
52+
</a>
53+
</p>
1354

1455
---
1556

16-
Created by the <a href="https://formkit.com">FormKit team</a>.
57+
<p align="center">
58+
Created by the <a href="https://formkit.com">FormKit team</a> · MIT License
59+
</p>

‎docs/public/img/read-the-docs.svg‎

Lines changed: 29 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)