Docs
Sortable

Sortable

Sortable provides a way to sort items in a list or grid.

Introduction to React
Learn the basics of React and component-based architecture
State Management
Explore different state management solutions in React
React Hooks
Master the use of hooks for state and side effects
Performance Optimization
Techniques to optimize React application performance
Testing React Apps
Learn testing strategies and tools for React applications
React Router
Implement client-side routing in React applications
Server Components
Build server-rendered React components for better performance
React Query
Manage server state and caching in React applications

About

The <Sortable /> component is built on top of @dnd-kit's sortable preset.

Installation

pnpm dlx cross-env REGISTRY_URL=https://ui-x.junwen-k.dev/r pnpm dlx shadcn@latest add sortable

Usage

import {
  Sortable,
  SortableGrid,
  SortableItem,
  SortableItemTrigger,
  SortableList,
  SortableOverlay,
} from "@/components/ui/sortable"
<Sortable>
  <SortableList>
    <SortableItem>
      <SortableItemTrigger />
    </SortableItem>
  </SortableList>
  <SortableGrid>
    <SortableItem>
      <SortableItemTrigger />
    </SortableItem>
  </SortableGrid>
  <SortableOverlay />
</Sortable>

Examples

Default

Introduction to React
Learn the basics of React and component-based architecture
State Management
Explore different state management solutions in React
React Hooks
Master the use of hooks for state and side effects
Performance Optimization
Techniques to optimize React application performance
Testing React Apps
Learn testing strategies and tools for React applications
React Router
Implement client-side routing in React applications
Server Components
Build server-rendered React components for better performance
React Query
Manage server state and caching in React applications

Trigger

    Introduction to React
    Learn the basics of React and component-based architecture
    State Management
    Explore different state management solutions in React
    React Hooks
    Master the use of hooks for state and side effects
    Performance Optimization
    Techniques to optimize React application performance
    Testing React Apps
    Learn testing strategies and tools for React applications
    React Router
    Implement client-side routing in React applications
    Server Components
    Build server-rendered React components for better performance
    React Query
    Manage server state and caching in React applications

Disabled

Introduction to React
Learn the basics of React and component-based architecture
State Management
Explore different state management solutions in React
React Hooks
Master the use of hooks for state and side effects
Performance Optimization
Techniques to optimize React application performance
Testing React Apps
Learn testing strategies and tools for React applications
React Router
Implement client-side routing in React applications
Server Components
Build server-rendered React components for better performance
React Query
Manage server state and caching in React applications

Swap

    Introduction to React
    Learn the basics of React and component-based architecture
    State Management
    Explore different state management solutions in React
    React Hooks
    Master the use of hooks for state and side effects
    Performance Optimization
    Techniques to optimize React application performance
    Testing React Apps
    Learn testing strategies and tools for React applications
    React Router
    Implement client-side routing in React applications
    Server Components
    Build server-rendered React components for better performance
    React Query
    Manage server state and caching in React applications

Form

    Introduction to React
    Learn the basics of React and component-based architecture
    State Management
    Explore different state management solutions in React
    React Hooks
    Master the use of hooks for state and side effects
    Performance Optimization
    Techniques to optimize React application performance
    Testing React Apps
    Learn testing strategies and tools for React applications
    React Router
    Implement client-side routing in React applications
    Server Components
    Build server-rendered React components for better performance
    React Query
    Manage server state and caching in React applications

Virtualized

    Item 1
    Description 0
    Item 2
    Description 1
    Item 3
    Description 2
    Item 4
    Description 3
    Item 5
    Description 4