Raycast Window & Search Bar
API Reference
clearSearchBar
Clear the text in the search bar.
Signature
Parameters
options
Can be used to control the behaviour after the search bar is cleared.
Object
options.forceScrollToTop
Can be used to force scrolling to the top. Defaults to scrolling to the top after the the search bar was cleared.
boolean
Return
A Promise that resolves when the search bar is cleared.
closeMainWindow
Closes the main Raycast window.
Signature
Example
You can use the popToRootType
parameter to temporarily prevent Raycast from applying the user's "Pop to Root Search" preference in Raycast; for example, when you need to interact with an external system utility and then allow the user to return back to the view command:
Parameters
options
Can be used to control the behaviour after closing the main window.
Object
options.clearRootSearch
Clears the text in the root search bar and scrolls to the top
boolean
options.popToRootType
Defines the pop to root behavior (PopToRootType); the default is to to respect the user's "Pop to Root Search" preference in Raycast
Return
A Promise that resolves when the main window is closed.
popToRoot
Pops the navigation stack back to root search.
Signature
Example
Parameters
options
Can be used to control the behaviour after going back to the root search.
Object
options.clearSearchBar
boolean
Return
A Promise that resolves when Raycast popped to root.
Types
PopToRootType
Defines the pop to root behavior when the main window is closed.
Enumeration members
Default
Respects the user's "Pop to Root Search" preference in Raycast
Immediate
Immediately pops back to root
Suspended
Prevents Raycast from popping back to root
Last updated