visionOS: Searchbar above window, like on Safari?

I'd like to place a search bar of top of the main window of my visionOS app. It should look similar to Safari's search bar, and also show search results as the user types. How can this be accomplished?

In general, I can use an ornament to do that. But how is the search results list built? Is this a sheet? But if so, how can it be dismissed when tapping outside of the sheet's area?

visionOS: Searchbar above window, like on Safari?
 
 
Q