Coder Social home page Coder Social logo

rivalee / miller-columns-element Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alphagov/miller-columns-element

0.0 2.0 0.0 1.09 MB

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

Home Page: https://alphagov.github.io/miller-columns-element/examples/

License: MIT License

JavaScript 88.03% SCSS 11.97%

miller-columns-element's Introduction

<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.

miller-columns-element's People

Contributors

alex-ju avatar dependabot-preview[bot] avatar dependabot[bot] avatar kevindew avatar murilodalri avatar thomasleese avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.