keky-tech / components

MIT License
0 stars 0 forks source link

Drag and drop components #1

Open bnofao opened 10 months ago

bnofao commented 10 months ago

Spec

Create reusable drag and drop components with radix-ui, react-dnd and tailwindcss. Radix-ui is already installed. You must create the components file drag-and-drop.tsx in apps/www/registry/ui/. Read CONTRIBUTING.md for more details.

drag-and-drop.tsx must export 3 components:

Demo Design

image After creation of components, create a demo in apps/www/registry/example/drag-and drop-demo.tsx and add it in apps/www/app/(sink)/page.tsx

Usage

Components usage must be like:

<DragAndDrop>
  <Draggable>
    <span> Draggable text <span>
  </Draggable>
  <DropZone>
    <span> Drop here </span>
  </DropZone>
</DragAndDrop>

Ou

<DragAndDrop>
  <DropZone>
    <Draggable>
      <span> Draggable text <span>
    </Draggable>
  </DropZone>
</DragAndDrop>

Note

Each components may have props. We want to make them headless as possible.

guilfred commented 8 months ago

Test ici https://github.com/keky-tech/components/pull/2 @bnofao