Tally UI

CustomerSelect

CustomerSelect presents searchable CustomerCard items with a highlighted selection, while the parent handles filtering and selection state.

Import

import { CustomerSelect } from '@tallyui/components';

Usage

<CustomerSelect
  customers={filteredCustomers}
  selected={selectedCustomer}
  onSelect={setSelectedCustomer}
  onSearch={setSearchQuery}
/>

A customer picker that renders a scrollable list of CustomerCard items. When a customer is selected, their card is highlighted at the top. The parent component owns the filtering logic -- this component simply calls onSearch with the query text and renders the customers array it receives.

Requires a ConnectorProvider ancestor in the component tree.

Props

PropTypeDefaultDescription
customersany[]requiredCustomer documents to display
selectedany---Currently selected customer
onSelect(customer) => voidrequiredCalled when a customer is tapped
traitsCustomerTraits<Doc>from ConnectorProviderCustomer traits used to read ids, names and emails; read from the connector context when omitted
onSearch(query: string) => voidrequiredCalled when search text changes
placeholderstring'Search customers...'Search input placeholder
showSearchbooleantrueRenders the search input; pass false when the parent renders its own, as CustomerPicker does
showAvatarbooleanfalseDraws an initials avatar before each row and the selected summary, as v2's cart dropdown
avatarTone'muted' | 'primary''primary'The avatar's tone; 'primary' is v2's look (light initials on a solid primary circle)
classNamestring---Override container styles

Live demo