Skip to main content

Interface: SearchBarProps

Defined in: components/SearchBar.tsx:44

Properties

applyOrderlists?

optional applyOrderlists?: boolean

Defined in: components/SearchBar.tsx:165

Apply the orderlist filter. Defaults to true when orderlistIds is non-empty, false otherwise — so an authenticated user without a contract still sees the full catalogue.


clearSignal?

optional clearSignal?: number

Defined in: components/SearchBar.tsx:174

Bump this counter to clear the search input from outside (e.g. on route change). Each unique value triggers a one-time reset of the local term.


companyId?

optional companyId?: number

Defined in: components/SearchBar.tsx:155

Active company ID from the company switcher.


configuration?

optional configuration?: any

Defined in: components/SearchBar.tsx:150

Configuration object providing: imageSearchFiltersGrid, imageVariantFiltersMedium — passed to CategoryService baseCategoryId — used when querying by term or brand urls.getProductUrl / urls.getClusterUrl — for card URL generation


containerClassName?

optional containerClassName?: string

Defined in: components/SearchBar.tsx:136

Additional class name for the container


currency?

optional currency?: string

Defined in: components/SearchBar.tsx:115

Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'.


debounceMs?

optional debounceMs?: number

Defined in: components/SearchBar.tsx:61

Debounce delay in milliseconds


formatPrice?

optional formatPrice?: (price) => string

Defined in: components/SearchBar.tsx:112

Custom price formatting function

Parameters

price

number

Returns

string


getResultHref?

optional getResultHref?: (result) => string

Defined in: components/SearchBar.tsx:84

Build the destination URL for a result item. When provided, each result renders as a real <a href> (middle-clickable, new-tab, crawlable) while onResultClick still fires for SPA navigation. Omit to keep the div-based fallback.

Parameters

result

SearchBarResult

Returns

string


getViewAllHref?

optional getViewAllHref?: (term) => string

Defined in: components/SearchBar.tsx:92

Build the destination URL for the "View all results" CTA. When provided, the CTA renders as a real <a href> (middle-clickable, new-tab, crawlable, keyboard-focusable) while onViewAllClick still fires for SPA navigation. Omit to keep the div-based fallback.

Parameters

term

string

Returns

string


graphqlClient?

optional graphqlClient?: GraphQLClient

Defined in: components/SearchBar.tsx:46

Propeller SDK GraphQL client. Resolved from PropellerProvider when omitted.


includeTax?

optional includeTax?: boolean

Defined in: components/SearchBar.tsx:127

When true, the tax-inclusive (net) price leads; false shows tax-exclusive (gross). Note the SDK mapping: price.net = incl. VAT, price.gross = excl. VAT. Resolved from <PropellerProvider> when omitted; defaults to false (excl.). Mirrors ProductCard/ProductPrice so the dropdown agrees with every other price surface.


inputClassName?

optional inputClassName?: string

Defined in: components/SearchBar.tsx:139

Extra classes for the search input, merged over the defaults via tailwind-merge.


labels?

optional labels?: Record&lt;string, string>

Defined in: components/SearchBar.tsx:118

Labels for the component


language?

optional language?: string

Defined in: components/SearchBar.tsx:52

Language code for search requests


maxResults?

optional maxResults?: number

Defined in: components/SearchBar.tsx:64

Maximum number of results to show in dropdown


minSearchLength?

optional minSearchLength?: number

Defined in: components/SearchBar.tsx:58

Minimum characters before search triggers


noImageUrl?

optional noImageUrl?: string

Defined in: components/SearchBar.tsx:67

Fallback image URL when product has no image


onResultClick?

optional onResultClick?: (result) => void

Defined in: components/SearchBar.tsx:73

Fires when a result item is clicked. Receives the result object.

Parameters

result

SearchBarResult

Returns

void


onSubmit?

optional onSubmit?: (term) => void

Defined in: components/SearchBar.tsx:70

Fires when the search form is submitted (Enter key). Receives the search term.

Parameters

term

string

Returns

void


onViewAllClick?

optional onViewAllClick?: (term) => void

Defined in: components/SearchBar.tsx:76

Fires when "View all results" is clicked. Receives the search term.

Parameters

term

string

Returns

void


orderlistIds?

optional orderlistIds?: number[]

Defined in: components/SearchBar.tsx:158

Scope the autosuggest fetch to specific orderlist IDs (e.g. a chosen B2B contract).


placeholder?

optional placeholder?: string

Defined in: components/SearchBar.tsx:55

Placeholder text for the search input


priceLabels?

optional priceLabels?: Record&lt;string, string>

Defined in: components/SearchBar.tsx:133

Labels for the incl./excl. price suffix. Keys: inclTax, exclTax. Falls back to English 'incl. VAT' / 'excl. VAT'.


productTrackAttributes?

optional productTrackAttributes?: string[]

Defined in: components/SearchBar.tsx:168

Attribute names to request per product, e.g. ['MPN']. See ProductGrid.


renderPrice?

optional renderPrice?: (result) => ReactNode

Defined in: components/SearchBar.tsx:109

Replace the price cell of each result with custom content. When provided, this fully overrides the default price rendering (and showPrice) — return any node (e.g. a "Price by quotation" label for a contract catalogue), or null to render nothing for that result. Keeps price/quotation wording app-specific rather than baked into the package.

Parameters

result

SearchBarResult

Returns

ReactNode


showPrice?

optional showPrice?: boolean

Defined in: components/SearchBar.tsx:100

Show the price column on each autosuggest result. Defaults to true. Set false to hide prices entirely in the dropdown — e.g. a B2B contract-catalogue context where prices are quote-only and shouldn't appear in the live preview. Ignored when renderPrice is provided.


taxZone?

optional taxZone?: string

Defined in: components/SearchBar.tsx:142

Tax zone used for price calculation. Defaults to 'NL'.


user?

optional user?: Contact | Customer | null

Defined in: components/SearchBar.tsx:49

The currently logged in user (Contact or Customer)