Reorderable tabs with spring physics on drop, staggered cascade, velocity-aware snap, and audio tick.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- motion
- @dnd-kit/core
- @dnd-kit/sortable
Code
"use client";
import { DragAndDropTabs } from "@/registry/ruixenui/drag-and-drop-tabs";
export default function DragAndDropTabsDemo() {
return (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
minHeight: "50vh",
}}
>
<DragAndDropTabs
items={[
{ value: "tab1", label: "Tab 1", content: "Content for Tab 1." },
{ value: "tab2", label: "Tab 2", content: "Content for Tab 2." },
{ value: "tab3", label: "Tab 3", content: "Content for Tab 3." },
{ value: "tab4", label: "Tab 4", content: "Content for Tab 4." },
{ value: "tab5", label: "Tab 5", content: "Content for Tab 5." },
]}
defaultValue="tab1"
/>
</div>
);
}
































