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

No props documented

QuickSearch

NameDefaultDescription
isOpen Required
boolean

Controls whether the dialog is rendered and visible.

retainScrollPosition
boolean

When true, opening the overlay preserves the current page scroll position. When false, the overlay scrolls the page to the top before anchoring.

initialQuery
string

Initial query text used when the dialog opens.

onClose Required
() => void

Called 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; }) => void

Runs a search query through the host's navigation contract.

onFeedbackClick
() => void

Optional click handler for rendering the footer feedback action. When omitted, the "Give feedback" link is hidden.

onQueryChange
(query: string) => void

Called whenever the user edits the query (typing or autocomplete).

onManageSavedSearches
(query: string) => void

Called with the current query when the saved-search management action is selected.

isSearchPage
boolean

When 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 'start' (left-anchored, grows right). Use 'end' for a narrow trigger near the viewport's right edge (the marketing header) so the panel right-aligns to the anchor and grows left with a comfortable desktop width.