npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@royallondon/design-system-component-search-keyword

v2.3.0

Published

Royal London Design System - Search keyword package

Readme

Installation

Install the Search keyword package from npm

npm install @royallondon/design-system-component-search-keyword

Import the required CSS file

@import '@royallondon/design-system-component-search-keyword/dist/search-keyword';

Add the html code for the search keyword component

<form method="" class="rl-c-search--ice">
  <label class="rl-u__visuallyhidden" for="search-input">Search</label>
  <input
    type="text"
    class="rl-c-search__input rl--bg-color-white"
    id="search-input"
    aria-describedby="search-input"
    placeholder="Search Royal London"
  />
  <button type="submit" class="rl-c-search__submit">
    <svg class="rl-f-icon rl-f-icon--md rl-f-icon--primary">
      <title>Search</title>
      <use href="/assets/icons.svg#search"></use>
    </svg>
  </button>
</form>

Import the js for the component, json data to be used for the search results and initialise the new searchBar class

import SearchBar from '@royallondon/design-system-component-search-keyword/dist/search-keyword.js';
import data from 'PathToJsonFile.json';

document.addEventListener('DOMContentLoaded', () => {
  new SearchBar(data);
});
  1. You can pass in the following options to searchBar js class
document.addEventListener('DOMContentLoaded', () => {
  const searchBar = new SearchBar(searchData, {
    formSelector: '#my-search-form',
    inputSelector: '#my-search-input',
    submitButtonSelector: '#my-search-submit',
    minCharacters: 2, // Set to 2 if you want search to start after 2 characters are typed
  });
});

Support

Issues and questions are handled through the Royal London Design System support page.

Licence

@royallondon/design-system-component-search-keyword

This package is published primarily for use in Royal London products. It is made available publicly so that partners and suppliers building Royal London experiences can consume it directly.

Use of this package is subject to the Royal London Authorised Use Licence. See the LICENSE.md file included in this package.

The Search keyword component for the Royal London Design System. For design guidance, examples and accessibility notes, see the Search keyword page.

Release log

| Version | Release notes | | ------- | --------------------------------------------------------------------------------------------------------------------------------- | | 2.3.0 | Prepare for public npm release: add licence, publish dist only (src removed), remove source maps; add TypeScript declarations | | 2.2.5 | Move to new feed | | 2.2.4 | Update border for compatibility with Forms 2.x and 3.x | | 2.2.0 | Apply new icons and latest tokens added to foundations | | 2.1.1 | Add custom font weight to search result titles | | 2.1.0 | Update search keyword to use type tokens | | 2.0.1 | Fix for width not collapsing on small screens | | 2.0.0 | Upgrade for compatibility with foundations v2 | | 1.1.0 | Fixes for screen reader announcing results | | 1.0.0 | First release of search keyword component |