Interactive reference

Playground.

Change a configuration, open the picker, and inspect what the component returns. Each configuration starts a fresh selection session.

Live component

Parts to add to order
Choose parts…

Search by part or SKU, select records, then apply. Cancel leaves the previous value unchanged.

Committed value
[]
Recent events (newest first)
No events yet.
Usage example · TSX
import { LookupSelect } from "react-lookup-select";
import type { ColumnDef } from "react-lookup-select";
import "react-lookup-select/styles.css";

type Part = { id: number; code: string; name: string; warehouse: string; stock: number };
const data: Part[] = Array.from({ length: 8 }, (_, i) => ({
  id: i + 1, code: "P-" + (i + 1), name: "Part " + (i + 1),
  warehouse: "North", stock: 10
}));

const columns: ColumnDef<Part>[] = [
  { key: "code", title: "SKU", sortable: true },
  { key: "name", title: "Part", sortable: true },
  { key: "warehouse", title: "Warehouse", sortable: true },
  { key: "stock", title: "Stock", sortable: true },
];

export default function PartPicker() {
  return <LookupSelect
    data={data}
    columns={columns}
    mapper={{ getId: row => row.id, getText: row => row.name }}
    mode="multiple"
    returnShape="id-text"
    variant="default"
    size="medium"
    virtualization={false}
    pageSize={20}
    onChange={value => console.log(value)}
  />;
}