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

vcl-tab-nav

v0.1.0

Published

List of navigation items arranged as tabs

Downloads

60

Readme

VCL tab-nav

List of navigation items arranged as tabs.

Features

  • Two style variants.
  • Four orientations.
  • Rich tab-labels.
  • Justified tab alignment.

Usage

The tab bar containing the tabs is built from a unordered list and the vclTabs class. It contains n vclTabs. The tab items can be made of anchor tags or just textual. An anchor tag is only needed if users should be able to open a tab in a different window by an URL. Buttons can be embedded as shown in the example below to offer an additional interaction. A tab with only a button, for example to open new tabs like in the example below contains just a button as tab content. The selected tab vclSelected is visually highlighted and can be disabled via vclDisabled.

basic example

In terms of accessibility, the following example with proper ARIA attributes is optimal.

basic no links

Apart from buttons, tabs may also contain other components like a badge as in the example above. To get proper margins, all elements within a vclTab get the vclTabLabel.

Add the modifier class vclTabStyleUni for uni colored tabs. This style is more suitable for showing tabs unobtrusively within content textual for example.

uni example

The class vclTabbable is used to create a wrapper for the tabs and the content area. The content area can be built from various components such as a panel or the included classes vclTabContent and vclTabPanel.

By default tabs are laid out as shown above. Different layouts are possible as shown below.

Modifier class vclTabLeft.

left1 example

left2 example

Modifier class vclTabRight.

right1 example

right2 example

Justified tabs can be achieved using the appropriate layout attributes.

uni example

Classes

  • vclTabbable: Wrapper of tab bar and tab content area.
  • vclTabs: Tab bar.
  • vclTab: Tab.
  • vclTabLabel: Optional class for the label(s) inside the tab.
  • vclTabContent: Optional content area.
  • vclTabPanel: Optional inner content area.

Modifiers

For vclTabbable

  • vclTabsLeft
  • vclTabsRight
  • vclTabsBottom
  • vclNoBorder: remove any border from vclTabContent and vclTabs.

For vclTabs

  • vclTabStyleUni
  • vclTabNavJustified

For vclTab

  • vclSelected
  • vclDisabled

Variables

Normal Variant

  • --tab-nav-border-color
  • --tab-nav-tab-bg-color
  • --tab-nav-tab-bg-hover-color
  • --tab-nav-tab-bg-selected-color
  • --tab-nav-tab-bg-disabled-color
  • --tab-nav-tab-border-selected-color
  • --tab-nav-tab-disabled-color
  • --tab-nav-tab-color
  • --tab-nav-tab-selected-color
  • --tab-nav-tab-hover-color
  • --tab-nav-tab-button-label-color
  • --tab-nav-tab-button-label-hover-color
  • --tab-nav-tab-button-selected-label-color

Uni Variant

  • --tab-nav-tab-bg-color--uni
  • --tab-nav-tab-bg-selected-color--uni
  • --tab-nav-tab-bg-disabled-color--uni
  • --tab-nav-tab-color--uni
  • --tab-nav-tab-hover-color--uni
  • --tab-nav-tab-color-selected--uni
  • --tab-nav-tab-disabled-color--uni

Demo

example.html on GH-pages.