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
947 B
TypeScript
31 lines
No EOL
947 B
TypeScript
/**
|
|
* SortableGrid Component
|
|
*
|
|
* A CSS Grid-based sortable container with drag-and-drop reordering.
|
|
* Uses framer-motion for smooth animations.
|
|
*/
|
|
import { type ReactNode } from 'react';
|
|
import type { SortableGridProps } from './types';
|
|
/**
|
|
* SortableGrid Component
|
|
*
|
|
* Renders items in a CSS Grid with drag-and-drop reordering support.
|
|
* Items animate smoothly when reordered.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* const [widgets, setWidgets] = useState(['temp', 'clock', 'fan', 'power']);
|
|
*
|
|
* <SortableGrid
|
|
* items={widgets}
|
|
* getItemKey={(item) => item}
|
|
* renderItem={(item, index, isDragging) => (
|
|
* <WidgetCard title={item} />
|
|
* )}
|
|
* onReorder={setWidgets}
|
|
* grid={{ columns: 4, gap: 16 }}
|
|
* />
|
|
* ```
|
|
*/
|
|
export declare function SortableGrid<T>({ items, getItemKey, renderItem, onReorder, grid, itemType: _itemType, disabled, className, }: SortableGridProps<T>): ReactNode;
|
|
//# sourceMappingURL=SortableGrid.d.ts.map
|