Install

Works with Drupal: ^10.3 || ^11 || ^12

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 138.45 KB
MD5: 0cb417e3490d307c7c1b76e8f5b5b898
SHA-1: 39704d918257540b22e53c86041645d8eb6d9032
SHA-256: 71fdd1c07b80cf53d357fb5d945d7324f2755d2fdb4b2e9d3df8e8594ede334c
Download zip 245.07 KB
MD5: 575fc230db5882adda53af2f6693f11d
SHA-1: 0aa6faacc1e9f1b03558c4aceddd255fc4f84e05
SHA-256: b9c2b83f5331a6c6933f84e7f8939f30f471d0781f400460d3c697f723efe2c2

Release notes

Search Web Components 1.0.0-beta1 is the first beta of the 1.0 line. The 1.0 API is complete and documented, every site on 1.0.0-alpha6 has an upgrade path, and the beta is out so sites can test both before 1.0.0. A beta can still change before 1.0.0; report what breaks or reads wrong in the issue queue. The Drupal module and the npm package drupal-search-web-components release together and share a version. For every component, setting, and hook, see the documentation; for every change, the changelog.

Before you update

  1. Update search_api_decoupled to 1.0.0-alpha44 or later; the module requires it.
  2. Update the Drupal module before the npm package, and clear cached endpoint responses.
  3. Enable Search Web Components: Facets if Blocks is enabled without it. Blocks now depends on it.
  4. Run the database updates, export the configuration, and rebuild caches. The post updates convert endpoint page sizes, sort options, and the option blocks' settings. Each is safe to run again, and its message names what to check.
  5. Read "What changes for every site" below.

What's new

  • Searching another API. search-root has request hooks to build the request, send it, and map the response, so a subclass searches any Drupal site's endpoint or an API that is not Drupal. Searching another API
  • Drupal Canvas and Twig. Every component is a single directory component, with two Canvas layout components and a Canvas submodule that adds a facet picker, an endpoint picker, and row editing for sort options. Drupal Canvas, Twig
  • Sort options with an alias and a default. The page URL reads ?sort=newest, the endpoint form edits sort options, page sizes, listing layouts, and result elements in place, and a sort option can have tie-breakers. Endpoint settings
  • Accessibility. Every control has an accessible name, set by an attribute and a block or layout setting; each search is announced to screen readers; focus stays in place after a search; the HTML dropdown follows the W3C combobox pattern; the modal filter dialog keeps focus inside. Accessibility
  • New components and settings. A loading indicator with showOnFirstLoad, keepFilters on the search input, an applied count on the dialog toggle, facets that keep one applied value at a time, and facet-button rendering hierarchy children.
  • A site script can subclass a component with no build step. window.SearchWebComponents holds every class and Lit's template helpers. A subclass on a Drupal page
  • Documentation and Storybook. A getting started guide for Layout Builder and one for Drupal Canvas, a developer guide, and a Storybook page per component with a story for each attribute, its events, classes, ARIA attributes, hooks, and methods. Storybook

What changes for every site

  • Theme overrides of the blocks stop applying. The swc_* theme hooks and swc-*.html.twig templates are gone; the blocks render single directory components. The status report lists the overrides that no longer apply. A template becomes a theme component with replaces:; a preprocess becomes hook_preprocess_block() changing the component's props. Customizing in Drupal code
  • The filter dialog opens only below 768 px on a root the module renders without an explicit dialogBreakpoint. Pass -1 from Twig or Canvas to keep a dialog at every width. The two-column layout stacks its columns below 40em.
  • Sort options have an alias and a default. The post update gives each option an alias and makes the option that sorted the way the endpoint already did the default. When none matches, it adds an option for that sort as the default and names the endpoint; rename the option on the endpoint form.
  • Page sizes live in the endpoint's Items per page options. The post update moves them. A page whose layout sets a different default size now starts with that size.
  • The first save of an endpoint form after updating is refused until Limit is one of the page sizes, no two result elements share a key, no key or size repeats, and exactly one sort option is the default.
  • Block options are rows, not text. The post updates convert the sort, page size, listing layout, and results blocks.
  • A facet created on an endpoint starts with the Checkbox widget, and the facet form of an endpoint facet shows only Search Web Components widgets.
  • New markup for assistive technology, listed per element in Storybook: role="search" on the search forms, role="group" and aria-label on the facet, sort, page size, and switcher elements, role="navigation" on the pager, and a status region appended to body. Every name and announcement is a setting.
  • Spellcheck and Canvas are experimental submodules. Their settings and behaviour can change in a minor release.

If you customized the module or the elements

A FacetBlockBase subclass, a custom event subscriber, a script on the swc-* events, a subclass of an element, or a deep import of the npm package: the changelog's "If you customized" section lists each change with what to do, in Drupal code and in the elements and the npm package.

Fixes

  • The dist/ modules import each other with the .js extension, so the package loads through an import map, in Node, and with webpack 5.
  • Numeric response keys sent as strings are read as numbers.
  • A request with only sort or only order is completed from the endpoint's default, so search-sort highlights the option in use.
  • The Facets submodule runs the facet query types once per request and declares each facet as a cache dependency of the response.
  • The two-column layout's 15/85, 85/15, 20/80, and 80/20 widths split the row as named.

Known issues

  • The Spellcheck submodule still needs the search_api_spellcheck patch named in its README.
  • The test suite does not run on PHPUnit 12 yet, so the beta is untested on Drupal 12.

Links

Read the documentation

See the components in Storybook

Try the Umami demo

Read the full changelog

Created by: ctrladel
Created on: 15 Oct 2026 at 23:07 UTC
Last updated: 15 Oct 2026 at 23:07 UTC
Bug fixes
New features

Other releases