QuickSearch
QuickSearch component for Global Navigation
Internal Component
This component is intended solely for use within GitHub and is not available for external use.Props
QuickSearch
QuickSearch
| Name | Default | Description |
|---|---|---|
isOpen Required | booleanControls whether the dialog is rendered and visible. | |
retainScrollPosition | booleanWhen true, opening the overlay preserves the current page scroll position. When false, the overlay scrolls the page to the top before anchoring. | |
initialQuery | stringInitial query text used when the dialog opens. | |
onClose Required | () => voidCalled when the dialog should be closed (Escape, backdrop click, etc.). | |
returnFocusRef | React.RefObject<HTMLElement>Element to restore focus to when the dialog closes. | |
anchorRef | React.RefObject<HTMLElement>Element the panel anchors to (the header search region). The panel matches its left/top/width so it renders top-flush and spans the same width. | |
additionalSuggestions | QuickSearchSuggestion[]Extra suggestions injected after the built-in repo/org results. Useful for surfacing product-specific shortcuts (e.g. a Copilot entry point). | |
searchContext | Record<string, string> | |
onSearchSubmit | (query: string) => void | |
onSuggestionSelect | (suggestionType: SuggestionAction) => void | |
onNavigateToSearch | (query: string, options?: { openInNewWindow?: boolean; }) => voidRuns a search query through the host's navigation contract. | |
onFeedbackClick | () => voidOptional click handler for rendering the footer feedback action. When omitted, the "Give feedback" link is hidden. | |
onQueryChange | (query: string) => voidCalled whenever the user edits the query (typing or autocomplete). | |
onManageSavedSearches | (query: string) => voidCalled with the current query when the saved-search management action is selected. | |
isSearchPage | booleanWhen true the panel fades in without the slight downward slide. Used on the search page, where the overlay opens directly over the header search box and the slide reads as a distracting shift. | |
align | "start" | "end"Horizontal alignment of the overlay panel relative to the anchor. Defaults
to |