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

basic-tabs

v0.8.0

Published

A set of pages with a tab strip governing which page is shown.

Downloads

7

Readme

API Documentation

Tabs ⇐ ElementBase

A set of pages with a tab strip governing which page is shown.

This stock combination puts together a basic-tab-strip and a basic-modes element. If you'd like to create something more complex than this arrangement, you can use either of those elements on its own.

Since this component uses basic-tab-strip internally, it obtains the names of the individual tabs the same way: from a child's aria-label property. Example:

<basic-tabs>
  <div aria-label="One">Page one</div>
  <div aria-label="Two">Page two</div>
  <div aria-label="Three">Page three</div>
</basic-tabs>

Kind: global class Extends: ElementBase
Mixes: ItemsSelection , TargetSelection

tabs.applySelection(item, selected)

Apply the indicate selection state to the item.

The default implementation of this method does nothing. User-visible effects will typically be handled by other mixins.

Kind: instance method of Tabs. Defined by ItemsSelection mixin.

| Param | Type | Description | | --- | --- | --- | | item | HTMLElement | the item being selected/deselected | | selected | boolean | true if the item is selected, false if not |

tabs.canSelectNext : boolean

True if the selection can be moved to the next item, false if not (the selected item is the last item in the list).

Kind: instance property of Tabs. Defined by ItemsSelection mixin.

tabs.canSelectPrevious : boolean

True if the selection can be moved to the previous item, false if not (the selected item is the first one in the list).

Kind: instance property of Tabs. Defined by ItemsSelection mixin.

tabs.itemAdded(item)

Handle a new item being added to the list.

The default implementation of this method simply sets the item's selection state to false.

Kind: instance method of Tabs. Defined by ItemsSelection mixin.

| Param | Type | Description | | --- | --- | --- | | item | HTMLElement | the item being added |

tabs.items : Array.<HTMLElement>

The current set of items in the list.

Kind: instance property of Tabs. Defined by TargetSelection mixin.

tabs.itemsChanged()

This method is invoked when the underlying contents change. It is also invoked on component initialization – since the items have "changed" from being nothing.

Kind: instance method of Tabs. Defined by TargetSelection mixin.

"selected-index-changed"

Fires when the selectedIndex property changes.

Kind: event emitted by Tabs. Defined by ItemsSelection mixin.

| Param | Type | Description | | --- | --- | --- | | detail.selectedIndex | number | The new selected index. |

"selected-item-changed"

Fires when the selectedItem property changes.

Kind: event emitted by Tabs. Defined by ItemsSelection mixin.

| Param | Type | Description | | --- | --- | --- | | detail.selectedItem | HTMLElement | The new selected item. | | detail.previousItem | HTMLElement | The previously selected item. |

tabs.selectedIndex : number

The index of the item which is currently selected.

If selectionWraps is false, the index is -1 if there is no selection. In that case, setting the index to -1 will deselect any currently-selected item.

Kind: instance property of Tabs. Defined by ItemsSelection mixin.

tabs.selectedItem : object

The currently selected item, or null if there is no selection.

Setting this property to null deselects any currently-selected item.

Kind: instance property of Tabs. Defined by ItemsSelection mixin.

tabs.selectedItem : HTMLElement

The currently selected item, or null if there is no selection.

Kind: instance property of Tabs. Defined by TargetSelection mixin.

tabs.selectFirst()

Select the first item in the list.

Kind: instance method of Tabs. Defined by ItemsSelection mixin.

tabs.selectionRequired : boolean

True if the list should always have a selection (if it has items).

Kind: instance property of Tabs. Defined by ItemsSelection mixin. Default: false

tabs.selectionWraps : boolean

True if selection navigations wrap from last to first, and vice versa.

Kind: instance property of Tabs. Defined by TargetSelection mixin. Default: {false}

tabs.selectionWraps : boolean

True if selection navigations wrap from last to first, and vice versa.

Kind: instance property of Tabs. Defined by ItemsSelection mixin. Default: false

tabs.selectLast()

Select the last item in the list.

Kind: instance method of Tabs. Defined by ItemsSelection mixin.

tabs.selectNext()

Select the next item in the list.

Kind: instance method of Tabs. Defined by ItemsSelection mixin.

tabs.selectPrevious()

Select the previous item in the list.

Kind: instance method of Tabs. Defined by ItemsSelection mixin.

tabs.tabPosition : string

The position of the tab strip relative to the element's children. Valid values are "top", "left", "right", and "bottom".

Kind: instance property of Tabs Default: "&quot;top&quot;"

tabs.target : HTMLElement

Gets/sets the target element to which this component will delegate selection actions.

Kind: instance property of Tabs. Defined by TargetSelection mixin.