Package: @lilith/ui-dnd Split from: lilith/ui.git or lilith/build.git Publish workflow: calls lilith/workflows/.forgejo/workflows/publish-npm.yml@main
31 lines
No EOL
902 B
TypeScript
31 lines
No EOL
902 B
TypeScript
/**
|
|
* SortableList Component
|
|
*
|
|
* A list-based sortable container with drag-and-drop reordering.
|
|
* Supports vertical and horizontal layouts.
|
|
*/
|
|
import { type ReactNode } from 'react';
|
|
import type { SortableListProps } from './types';
|
|
/**
|
|
* SortableList Component
|
|
*
|
|
* Renders items in a flex list with drag-and-drop reordering support.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* const [tasks, setTasks] = useState(['Task 1', 'Task 2', 'Task 3']);
|
|
*
|
|
* <SortableList
|
|
* items={tasks}
|
|
* getItemKey={(item) => item}
|
|
* renderItem={(item, index, isDragging) => (
|
|
* <TaskCard title={item} />
|
|
* )}
|
|
* onReorder={setTasks}
|
|
* direction="vertical"
|
|
* gap={8}
|
|
* />
|
|
* ```
|
|
*/
|
|
export declare function SortableList<T>({ items, getItemKey, renderItem, onReorder, gap, direction, itemType: _itemType, disabled, className, }: SortableListProps<T>): ReactNode;
|
|
//# sourceMappingURL=SortableList.d.ts.map
|