Skip to content

Guide · Open source

How to use list.js: search, sort and filter HTML lists

Updated · written with AI from the project's own documentation and checked against our catalogue data

List.js is an open-source JavaScript library that adds search, sort and filtering to HTML tables, lists and similar elements. It is designed to work on HTML you already have, so you do not need to rebuild your markup from scratch. After this guide, you will know how to install it, how it is meant to be used, and when it is a good fit for your project.

List.jsjavve/list.js · ★ 11.2k · MIT

Quick start

  1. 1Check the requirements. Confirm you have Node.js or a package manager such as npm, and that your target browsers include IE9 or newer if you need older support.
  2. 2Install the package. Run npm install list.js in your project folder.
  3. 3Prepare the HTML. Use the existing table, list or element that already displays your items.
  4. 4Read the docs. Open listjs.com/docs to check options and the List API before writing code.
  5. 5Start with search. Add the search feature first, using the Existing list example as a reference.
  6. 6Add sorting and filtering. Enable sort and filter next, using the List API sections for each.
  7. 7Test with real data. Load your full dataset in the browser to check speed on your target devices.

What list.js does and who it is for

List.js lets a web page search, sort and filter items that are already displayed in an HTML element such as a div, ul or table. The project describes itself as simple, small and free of dependencies, and says it can handle thousands of items in the browser.

It suits web developers who want interactive filtering on a page that already shows its data. It is a code library, so you need to write JavaScript to use it. It is not a no-code tool.

  • Good fit: adding search or sorting to an existing HTML table or list
  • Good fit: projects that want a small library with no dependencies
  • Good fit: sites that must support older browsers, since the README lists IE9+
  • Not a fit: very large server-side datasets, since the README only mentions thousands of items in the browser

Install list.js with npm

The README gives npm as the install method. You need Node.js or another package manager such as npm installed to use this route.

The README also lists Bower, a CDN link on CDNJS and a direct download of the compressed or uncompressed file. Pick the one that matches how your project is built.

npm install list.js

Prepare your existing HTML

List.js is built to be applied to markup you already have. The README lists support for tables, lists and elements such as div and ul. Give the element and its items the structure your page already uses, then point the library at that element.

The official documentation at listjs.com/docs covers the options and the List API. Read those pages before writing your setup code, since the option names and method signatures are defined there.

Add search, sort and filter

The README lists three core features: search, sort and filter. Each has its own section in the List API documentation at listjs.com/docs/list-api. Start with search, since it is the most common need, then add sorting and filtering once the basic list works.

The project also provides examples you can copy from: an existing list, an existing list with add, fuzzy search, pagination, searching a specific column, filtering in a range, and showing a message when there are zero results.

  • Existing list: https://listjs.com/examples/existing-list
  • Fuzzy search: https://listjs.com/examples/fuzzy-search
  • Pagination: https://listjs.com/examples/pagination

Add, edit and remove items

The README says list.js has a simple templating system that lets you add, edit and remove items. Use the Add, get, remove example and the Item API documentation to see how these operations are written.

Check the documentation for the exact method names before you rely on them, because this guide does not list them.

Compare list.js with similar libraries

The README names DataTables, Fuse.js and Tablesorter as comparable projects. List.js is aimed at adding interactivity to HTML you already have, with no dependencies. Choose the library whose scope matches your page: a full table system, a fuzzy search engine, or a lightweight helper.

What people use it for

  • Adding a search box above an existing HTML table of records
  • Letting visitors sort a product or contact list by column
  • Filtering a list of items within a range, using the filter-in-range example
  • Showing a message when a search returns zero items
  • Paging through a long list with the pagination example

Frequently asked questions

How do I install list.js?

The README gives the install command npm install list.js. You need Node.js or a package manager such as npm. The README also lists Bower, CDNJS and direct download options.

Is list.js free to use?

Yes. List.js is released under the MIT licence, as stated in the README's license section. The licence text names the copyright holder, Jonny Strömberg.

Does list.js have dependencies?

The README says list.js has no dependencies. It is described as small and easy to apply to existing HTML.

Does list.js work in older browsers?

The README lists support for Chrome, Safari, Firefox and IE9 or newer. Test your own site in the browsers you need.

How many items can list.js handle?

The README says it can handle thousands of items in the browser. It does not give a larger limit, so very large server-side datasets may need a different approach.

What are alternatives to list.js?

The README names DataTables, Fuse.js and Tablesorter as comparable projects. Pick based on whether you need a full table system, fuzzy search or a lightweight helper.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

List.js suits web developers who want search, sort and filtering added to HTML they already have, with no dependencies and support back to IE9. It is not suitable for people who want a no-code tool, for very large server-side datasets, or for teams that need a formal support plan, since the README does not describe one and the last push date is 2025-04-27.

Install options & downloads