← All proposals

Global search

A net-new component, GlobalSearch: one input that shows results in groups.

Net-new componentOpen in Storybook

proposals/GlobalSearch/custom.md36 lines · View on GitHub

Custom and net-new: Global search

Everything in this proposal that is not plain PDS v2.

Net-new components

  • .pds-global-search — one input that shows results in groups; the field and the results open as one box.
    • Parts and modifiers: .pds-global-search__backdrop, .pds-global-search__box, .pds-global-search__field, .pds-global-search__input, .pds-global-search__submit, .pds-global-search__panel, .pds-global-search__group, .pds-global-search__heading, .pds-global-search__heading-text, .pds-global-search__message, .pds-global-search__option, .pds-global-search__option--active, .pds-global-search__icon, .pds-global-search__body, .pds-global-search__line, .pds-global-search__label, .pds-global-search__inline, .pds-global-search__description, .pds-global-search__match, .pds-global-search__action, .pds-global-search__action--shown, .pds-global-search--open, .pds-global-search--expanded, .pds-global-search--dialog (the variant='dialog' root), .pds-global-search__trigger, .pds-global-search__trigger-icon, .pds-global-search__trigger-text, .pds-global-search__dialog, .pds-global-search__field-icon, .pds-global-search__footer

Additions to existing PDS components

None. It uses Icon, Spinner and Tag as they are, and the Badge proposal's as='kbd' (an extension of Badge, see ../Badge/). .pds-global-search__escape is only a layout hook on the Badge (flex: none).

Net-new props

All. Added 2026-11-20 for the nav version: shortcut (the key that opens the dialog, bound with useKeyboardShortcut), variant (inline default, dialog), the optional translationStrings keys dialogLabel, navigateHint and selectHint, and submitLabel became optional (the dialog has no send button). className, defaultActiveId, defaultQuery, errorText, groups, hasBackdrop, id, isLoading, isOpen, label, loadingText, noResultsText, onOpenChange, onOptionSelect, onQueryChange, onQuerySubmit, placeholder, query, statusText, submitLabel, translationStrings.

Local keyframes

  • global-search-dialog-in (the dialog): fade and a scale from 0.98, from the top center.
  • global-search-fade (backdrop) and global-search-reveal (results panel): the ease-in on open. Durations and easing are PDS tokens; the slide distance is --pds-spacing-xs.

Custom CSS variables

None.

Raw values kept on purpose

  • 40rem (inline-size of the dialog) and 32rem (its max-block-size) — about 640px and 512px, from the design; no dialog width token. The port keeps them unless a token exists.
  • 0.98 (starting scale of the dialog's opening motion) — a unitless ratio; no token. Estimated from a screen recording.
  • 2.5rem (min-block-size of a row) — a 40px touch and scan target; no row-height token. The port keeps it unless a token exists.
  • 24rem (max-block-size of the results) — about 380px, so the list scrolls inside the box instead of running off the screen. No token.
  • 30rem (container query) — where the tags give way. Matches the narrow container breakpoint; no token to reference in a query.
  • 0.0625rem (focus outline offset on the send button) — copied from PDS buttons.
  • Inline SVG up arrow (send button) — PDS has no arrowUp icon. See the open question about the icon; the port swaps it for IconButton once decided.