GLS Registry

Pudo Selector

A multi-select Parcel Shop (punto) picker with client-side search.

Installation

pnpm dlx shadcn@latest add @ecodeliver/pudo-selector

Usage

Pass the full pudos list. The parent owns the selected ids.

import { useState } from "react";
import { PudoSelector } from "@/components/registry/pudo-selector";
import { pudos } from "@/mocks";

export function Example() {
  const [selectedIds, setSelectedIds] = useState([]);

  return (
    <PudoSelector
      pudos={pudos}
      selectedIds={selectedIds}
      onToggle={setSelectedIds}
      onClear={() => setSelectedIds([])}
    />
  );
}

Behaviour

The trigger shows Punto and a count badge when something is selected. The popover searches by name and address (lineAddress1). Restablecer clears the selection.

API Reference

PudoSelector

PropTypeDefault
pudosPudoPoint[]-
selectedIdsstring[][]
onToggle(ids: string[]) => void-
onClear() => void-
classNamestring-
disabledbooleanfalse

PudoPoint

PropTypeDefault
idstring-
namestring-
lineAddress1string-
postalCodestring-

On this page