<List> is a compound component for rendering lists with built-in animation and drag-sort support. It works with .map() children to preserve VertzQL field selection.
Basic Usage
Animation
Enable FLIP animations for enter, exit, and reorder transitions:data-presence="enter", removed items get data-presence="exit". Use CSS to define enter/exit animations:
Custom Animation Config
prefers-reduced-motion is automatically respected. When the user prefers reduced motion, FLIP reorder animations are skipped.
Drag-and-Sort
Enable drag reordering withsortable and onReorder:
sortable is true:
<List.DragHandle>elements initiate drag onpointerdown- If no
<List.DragHandle>is present, the entire<List.Item>acts as the drag handle onReorder(fromIndex, toIndex)is called on drop- The dragged item receives
data-draggingduring drag
Sub-components
List.Item
Renders an<li> element with optional class distribution from the theme.
List.DragHandle
Renders a drag handle element inside a<List.Item>. Only active when sortable is true.
Props
List (root)
| Prop | Type | Default | Description |
|---|---|---|---|
classes | ListClasses | — | Class distribution for root, item, dragHandle |
className | string | — | Class for the root <ul> element |
animate | boolean | AnimateConfig | false | Enable FLIP animations |
sortable | boolean | false | Enable drag-and-sort |
onReorder | (from: number, to: number) => void | — | Called when an item is dragged to a new position |
AnimateConfig
| Prop | Type | Default | Description |
|---|---|---|---|
duration | number | 200 | FLIP animation duration in ms |
easing | string | 'ease-out' | CSS easing function |
List.Item / List.DragHandle
| Prop | Type | Description |
|---|---|---|
children | ChildValue | Content |
className | string | Additional CSS class |
Theming
With@vertz/theme-shadcn, List is automatically styled. The theme provides classes for root, item, and dragHandle slots: