Introducing PrimeReact v11-alpha 🎉Discover Now

PickList

PickList is used to transfer items between two lists with drag-drop and button controls.

  • New York
  • Rome
  • London
  • Istanbul
  • Paris
  • Tokyo
  • Berlin
  • Sydney
  • Toronto
  • Dubai
    preview

    Usage#

    PickList is a headless hook that manages two lists with transfer, reorder, and optional drag-and-drop between them. It works with Listbox for built-in selection and keyboard navigation.

    import { usePickList } from '@primereact/headless/picklist';
    const pickList = usePickList({
        source,
        target,
        selection,
        draggable: true,
        onChange: (e) => {
            setSource(e.source);
            setTarget(e.target);
        },
        onSelectionChange: (e) => setSelection(e.value)
    });

    Examples#

    Basic#

    Transfer items between two lists using the arrow buttons. Select items and click the transfer buttons to move them.

    • New York
    • Rome
    • London
    • Istanbul
    • Paris
    • Tokyo
    • Berlin
    • Sydney
    • Toronto
    • Dubai
      basic-demo

      Drag Drop#

      Enable drag-and-drop by setting draggable: true. Items can be dragged within a list to reorder, or dragged across lists to transfer.

      • New York
      • Rome
      • London
      • Istanbul
      • Paris
      • New York
      • Rome
      • London
      • Istanbul
      • Paris
      • New York
      • Rome
      • London
      • Istanbul
      • Paris
        drag-drop-demo

        Placeholder#

        Set placeholder: 'clone' to leave a visual copy of the dragged item in place. Use the data-sortable-placeholder attribute to style it with CSS.

        • New York
        • Rome
        • London
        • Istanbul
        • Paris
          placeholder-demo

          Checkbox#

          Combine with Checkbox and a select-all header for batch selection alongside drag-and-drop.

          • New York
          • Rome
          • London
          • Istanbul
          • Paris
          • Tokyo
          • Berlin
          • Sydney
          • Toronto
          • Dubai
            checkbox-demo