Skip to main content
  • Foundation
  • Color palette
  • Typography
  • Icons
  • Golden ratio
  • Grid system
  • Shadows & glow
  • Motion
  • Theme
  • Theme switcher
  • Color rosette
  • Theme customizer
  • Core
  • Button
  • Badge
  • Alert
  • Card
  • Dropdown
  • Menu
  • Popover
  • Doc Search
  • Global Search
  • Floating Action Button
  • Ripple
  • Expanding Cards
  • Spotlight
  • Timeline
  • Template
  • Navigation
  • Feedback
  • Modal
  • Toast
  • Tooltip
  • Chip
  • Skeleton
  • Preloader
  • Data display
  • Avatar
  • Table
  • Collection
  • Breadcrumb
  • Interactive
  • Tabs
  • Accordion
  • Flow
  • Draggable
  • Search
  • Canvas
  • Charts
  • Flowchart
  • Media
  • Image Box
  • Effects
  • Glass
  • Surfaces
  • Morph
  • Parallax
  • Liquid Gradient
  • Forms
  • Form controls
  • Login
  • Form validation
  • Datepicker
  • Timepicker
  • Rating
  • Switch
  • Slider
  • Stepper
  • Autocomplete
  • Transfer
  • Tree
  • Pagination
  • Button group
  • Primitives
  • Progress
  • Spinner
  • Code snippet
  • Layout
  • Primitives
  • Separator
  • Sidenav
  • Sticky
  • Waypoint (Scrollspy)
  • Off-canvas
  • Navbar
  • Oola Dock
  • Footer
Global search

VdGlobalSearch is a site-wide command palette: glass overlay, grouped results, and keyboard navigation. Pass a GlobalSearchAdapter — the component stays engine-agnostic (Fuse.js, REST, or in-memory). These docs use Fuse over search-index.json (no semantic model).

Live demo

Press ⌘K or / (when focus is not in an input). AI toggle uses a demo adapter — no model download.

Mechanics

ShortcutAction
⌘K / Ctrl+KOpen palette
/Open (when not typing in a field)
↑ ↓Move selection (wraps)
↵Select highlighted hit
escClose and clear query
vd:open-searchCustomEvent — e.g. dock brand

When co-mounting VdDocSearch, set :keyboard-shortcut="false" on the inline combobox so only the global palette owns Cmd/Ctrl+K.

Props

PropNotes
adapterRequired GlobalSearchAdapter — async search(query, { ai }).
shortcuttrue | { key, slash } — Cmd/Ctrl+K and / (default both on).
showAiToggleShow AI opt-in switch + disclaimer slot (default true).
ai{ enabled?, defaultEnabled?, persistKey? } — AI preference.
progressMessageFooter status while semantic model loads.
placeholder / dialogLabel / inputLabelCopy and ARIA labels.
resultsLabel / hintText / searchingText / aiToggleLabelCustom copy for the results landmark, footer hint, loading status, and AI switch label.
openEventNameCustomEvent name to open (default vd:open-search).

Emits & slots

EmitNotes
selectUser chose a hit (click or Enter).
searchDebounced search settled with query + hits.
update:aiEnabledAI toggle changed.
open / closeModal visibility.

#ai-notice — override EU AI Act disclaimer copy.

useGlobalSearch

Option / returnNotes
adapterSame GlobalSearchAdapter as the component.
minQueryLength / debounceMsDefaults 2 and 350.
shortcutGlobal keydown registration (onMounted).
ai.persistKeylocalStorage key for { aiEnabled }.
groupByOptional (hit) => categoryPath string.
open / close / move / setAiEnabledModal control.
highlight(text)Returns safe HTML with <mark> for query.
import { useGlobalSearch } from '@vanduo-oss/vd3';

const search = useGlobalSearch({
  adapter: myAdapter,
  ai: { persistKey: 'my-app-search', defaultEnabled: false },
  onSelect: (hit) => router.push(hit.route),
});

CSS custom properties

VariableDefaultNotes
--vd-global-search-modal-max-width640pxPalette width cap.
--vd-global-search-modal-top15vhVertical offset on desktop.
--vd-global-search-modal-border2px solid primary (none in dark)Outer modal outline.
--vd-global-search-input-border2px solid primary (1px in dark)Search field outline.
--vd-global-search-glass-opacity0.9Modal glass fill.
--vd-global-search-glass-blur20pxBackdrop blur strength.

Accessibility

  • Dialog: role="dialog", aria-modal="true".
  • Listbox renders only when results exist — avoids empty listbox axe violations.
  • Options use role="option" + aria-selected.
  • AI toggle links to disclaimer via aria-describedby when enabled.
  • Model progress uses aria-live="polite" in the footer.
Doc Search Inline combobox over caller-supplied docs — not site-wide.useSearch registry Headless async source registry without UI.