Introducing PrimeReact v11-alpha 🎉Discover Now
styledData

PickList

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

  • AE
    Amy ElsnerDesigner
  • AJ
    Asiya JavayantEngineer
  • OL
    Onyama LimbaProduct Manager
  • AF
    Anna FaliEngineer
  • BD
    Bernardo DominicDesigner
  • ES
    Elwin SharvillEngineer
  • IB
    Ioni BowcherQA
  • SS
    Stephen ShawEngineer
    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.

    • Amy Elsner
    • Asiya Javayant
    • Onyama Limba
    • Anna Fali
    • Bernardo Dominic
    • Elwin Sharvill
    • Ioni Bowcher
    • Stephen Shaw
    • Ivan Magalhaes
    • Xuxue Feng
      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.

      • Amy Elsner
      • Asiya Javayant
      • Onyama Limba
      • Anna Fali
      • Bernardo Dominic
      • Elwin Sharvill
      • Ioni Bowcher
      • Stephen Shaw
      • Ivan Magalhaes
      • Xuxue Feng
        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.

        • Amy Elsner
        • Asiya Javayant
        • Onyama Limba
        • Anna Fali
        • Bernardo Dominic
        • Elwin Sharvill
        • Ioni Bowcher
        • Stephen Shaw
        • Ivan Magalhaes
        • Xuxue Feng
          placeholder-demo

          Checkbox#

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

          • Amy Elsner
          • Asiya Javayant
          • Onyama Limba
          • Anna Fali
          • Bernardo Dominic
          • Elwin Sharvill
          • Ioni Bowcher
          • Stephen Shaw
          • Ivan Magalhaes
          • Xuxue Feng
            checkbox-demo