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 🙏

© 2024 – Pkg Stats / Ryan Hefner

miller-columns-element

v2.0.0

Published

Miller columns (cascading lists) for hierarchical topic selection on GOV.UK taxonomy

Downloads

489

Readme

<miller-columns> element

Express a hierarchy by showing selectable lists of the items in each hierarchy level.

Selection of any item shows that item’s children in the next list.

Installation

npm install --save miller-columns-element

Usage

This element is expected to be used in an application with govuk-frontend installed. The expected CSS dependencies are outlined in examples.scss.

<p id="navigation-instructions" class="govuk-body govuk-visually-hidden">
  Use the right arrow to explore sub-topics, use the up and down arrows to find other topics.
</p>

<miller-columns-selected id="selected-items" for="miller-columns" class="miller-columns-selected"></miller-columns-selected>

<miller-columns class="miller-columns" for="taxonomy" selected="selected-items" id="miller-columns" aria-describedby="navigation-instructions">
  <ul id="taxonomy">
    <li>
      <input class="govuk-checkboxes__input" type="checkbox" id="parenting-childcare-and-children-s-services">
      <label class="govuk-label govuk-checkboxes__label" for="parenting-childcare-and-children-s-services">
        Parenting, childcare and children's services
      </label>
      <ul>
        <li>
          <input class="govuk-checkboxes__input" type="checkbox" id="divorce-separation-and-legal-issues">
          <label class="govuk-label govuk-checkboxes__label" for="divorce-separation-and-legal-issues">
            Divorce, separation and legal issues
          </label>
        </li>
        <li>
          <input class="govuk-checkboxes__input" type="checkbox" id="childcare-and-early-years">
          <label class="govuk-label govuk-checkboxes__label" for="childcare-and-early-years">
            Childcare and early years
          </label>
        </li>
      </ul>
    </li>
  </ul>
</miller-columns>

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer 11
  • Microsoft Edge

Development

npm install
npm test

To continuously build files while developing run:

npm run watch

To install and run a local HTTP server using Node.js:

npm install -g http-server
http-server

To manually check examples in a web browser or using BrowserStack:

  • http://127.0.0.1:8080/examples/index.html (default example)
  • http://127.0.0.1:8080/examples/checkboxes-checked.html (with pre-selected items at page load)
  • http://127.0.0.1:8080/examples/miller-columns-test.html (example used for tests)

Alternatively, you can open one of the HTML files in the /examples directory for a quick preview.

License

Distributed under the MIT license. See LICENSE for details.