Components/Customer Search

Customer Search

Autocomplete that searches by name, document or phone. Surfaces VIP/Gold tier badge and the customer's historical spend in the results dropdown.


Installation

npx @ajax-ui/cli add customer-search

Props

  • results - array of { id, name, document?, phone?, email?, totalSpent?, tier? }.
  • query + onQueryChange for controlled search; defaultQuery for uncontrolled.
  • onSelect(customer) - fires when the user picks a result.
  • loading - shows a "Buscando..." state while the parent fetches.
  • tier per customer: "regular" | "vip" | "gold".