<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)
AnimateConfig
List.Item / List.DragHandle
Theming
With@vertz/theme-shadcn, List is automatically styled. The theme provides classes for root, item, and dragHandle slots: