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

@illinois-toolkit/ilw-tabs

v1.0.0

Published

Illinois Toolkit: This is a tab component, where you have a bunch of buttons that trigger new content information inside a fixed area.

Downloads

15

Readme

ilw-tabs

Links: ilw-tabs in Builder | Illinois Web Theme | Toolkit Development

Overview

This is a tab component, where you have a bunch of buttons that trigger new content information inside a fixed area. One section in a tabs component will always be visible (usually the first piece, but this may be changed). This is used to nicely display groups of information into a compact area.

Do not use this control when a user is going to read the entire page or you need all the information displayed (like a person completing multiple steps of a process). If you find yourself in this situation, you may want to break the page into multiple pages.

Each section of content is divided into 2 parts:

  • A tab list, which is a list of buttons used to make the panel visible. The tab list should only contain buttons.
  • A panel, which contains the primary content. This may contain text, headings, images, lists, links, and other rich-text information. Because the tab list is a list of buttons and tied to the panel programatically, you may or may not duplicate the button text in the tab panel.

When a tab is selected, its panel is made visible and other panels are hidden.

The ilw-tabs component has the following slots:

  • tabs: the list of buttons to display. This slot should only contain the button element.

The ilw-tabs component has the following attributes:

  • theme: the theme/background of the content. Options are blue, gray, white. Defaults to white.
  • width: whether or not this is contained in the parent (default), if it will expand to full width (full), or if just the background will expand and the text will be in a narrow window (auto), or if it will autosize to a page format (page).
  • horizontal: a boolean attribute that determines if the tabs are displayed in a horizontal view. Use this only if you have a few tabs in the list, as this is limited to a single row and may cause text to be truncated or displayed awkwardly. The default is to list the tabs vertically on the left-hand side, and in mobile view, both views will collapse to an accordion-like view.
  • default: the ID of the tab that should be opened on page load. This will default to the first tab.

Code Examples

<h2 id="tab-header">Programs</h2>
<ilw-tabs aria-labelledby="tab-header">
    <div slot="tabs" role="tablist">
        <button role="tab" aria-controls="tab-panel1" id="tab-button1">Degree Programs</button>
        <button role="tab" aria-controls="tab-panel2" id="tab-button2">Non-degree Programs</button>
        <button role="tab" aria-controls="tab-panel3" id="tab-button3">Classroom Experience</button>
    </div>
    <div id="tab-panel1" role="tabpanel" labelled-by="tab-button1">
      <h3>Degree Programs</h3>
      <!-- ... --->
    </div>
    <div id="tab-panel2" role="tabpanel" labelled-by="tab-button2">
      <h3>Non-degree Programs</h3>
      <!-- ... --->
    </div>
    <div id="tab-panel3" role="tabpanel" labelled-by="tab-button3">
      <h3>Classroom Experience</h3>
      <!-- ... --->
    </div>
</ilw-tabs>

Accessibility Notes and Use

The tabs are activated using the ARIA automatic tab pattern.

Ensure that the buttons and panels are labelled correctly inside the component using the id and aria-labelledby attributes. IDs should be unique in the HTML document.

A "nice-to-have" is to label the ilw-tabs component with a header using the aria-labelledby attribute.

External References

  • https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
  • https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/
  • https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_selection_follows_focus
  • https://www.nngroup.com/articles/tabs-used-right/