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

quill-header-list

v1.0.0

Published

Automatically generate directory

Readme

quill-header-list

demo

Usage

npm install quill-header-list
import HeaderList from 'quill-header-list';
import 'quill-header-list/dist/index.css';

Quill.register({ 'modules/header-list': HeaderList }, true);
new Quill('#editor', {
  theme: 'snow',
  modules: {
    'toolbar': {
      container: [[{ header: [null, 1, 2, 3, 4, 5, 6] }, 'header-list']],
      handlers: {
        'header-list': HeaderList.toolbarHandle
      }
    },
    'header-list': {
      container: document.getElementById('directory'), // specify a element to receive the header list
    },
  },
});

Options

| name | type | description | default | required | | --------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------- | | container | string \| HTMLElement | the list container. string must be the element id | - | true | | scrollContainer | string \| HTMLElement | editor scroll container. default is quill.root | - | false | | hideClass | number | the class name when list hidden | is-hidden | false | | topOffset | number \| () => number | the offset from the top(px) | 0 | false | | headerHeight | number | the header height in editor. this is for calculate header scroll highligh. don't make the height difference between h1 and h6 too much | 36 | false | | onBeforeShow | () => boolean | trigger before display. return true will cancel display | - | false | | onBeforeHide | () => boolean | trigger before hidden. return true will cancel hidden | - | false | | onItemClick | (id: string) => void | trigger when click list item. id is the header element id | - | false |

Module changed the header value struct in delta. If you have other custom values in header value, you need change class XXX extend Header with class XXX extend HeaderWithID and update formats function.

Other

Fixed Element On Page

If you have a fixed element in your page, you can use topOffset to return the height of the fixed element. Then the header-list-item scroll position will not cover by the fixed element.

new Quill('#editor', {
  theme: 'snow',
  modules: {
    'toolbar': [[{ header: [null, 1, 2, 3, 4, 5, 6] }, 'header-list'],],
    'header-list': {
      container: document.getElementById('directory'), // specify a element to receive the header list
      topOffset: () => {
        // get the height of the fixed element
        const navOffset = document.querySelector('.fixed')?.getBoundingClientRect().height || 0;
        return navOffset;
      },
      // or if you already know the height
      // topOffset: 36,
    },
  },
});

Custom Header Id attribute

import HeaderList, { HeaderWithID } from 'quill-header-list';
import 'quill-header-list/dist/index.css';

// set custom header id attribute to 'id' (default is 'data-block-id')
HeaderWithID.idKey = 'id';
Quill.register({ 'modules/header-list': HeaderList }, true);