import { SelectTrigger } from "@servicetitan/anvil2";
function ExampleComponent() {
return (
<SelectTrigger
itemToString={(item) => item?.label ?? ""}
selectedItem={selectedItem}
onClick={() => {}}
onChange={(item) => {}}
/>
); }
SelectTrigger Props
The SelectTrigger component accepts most props that can be passed to TextField, such as label, required, moreInfo, size, prefix, suffix, description, hint, and error.Remove the clear button to disable user clearing the input after selecting.
itemToKey
(item: Item) => string | number | null
Function to get a unique key from an item.
Function to convert an item to a display string.
The onChange will fire when the input is cleared or if any individual item
is removed
Only if multiple is false
Only if multiple is true.