# @wearediagram/wsol.tabs

> Content tabs that toggle content when clicked.

Latest version **4.0.3** (published 2024-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wearediagram/wsol.tabs
pnpm add @wearediagram/wsol.tabs
yarn add @wearediagram/wsol.tabs
bun add @wearediagram/wsol.tabs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2024-01-05 |
| First published | 2021-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 459.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | sstanleydiagram, diagramderrik, nmelville |
| Keywords | tabs |

## Links

- npm: https://www.npmjs.com/package/@wearediagram/wsol.tabs
- Repository: https://github.com/websolutions/tabs
- Issues: https://github.com/websolutions/tabs/issues
- npm.io page: https://npm.io/package/@wearediagram/wsol.tabs

## Recent versions

- 4.0.3 (latest) — 2024-01-05
- 4.0.2 — 2023-12-20
- 4.0.1 — 2022-06-14
- 4.0.0 — 2022-05-17
- 3.1.4 — 2021-12-10
- 3.1.3 — 2021-12-10
- 3.1.2 — 2021-12-07
- 3.1.1 — 2021-12-07

## README

# Tabs

Content tabs that toggle content when clicked.

## Installation

Install via [Bower](http://bower.io):
```
$ bower install websolutions/tabs --save
```

## Usage

The most basic example follows this DOM structure:
``` html
<div class="tabs">
  <ul class="tab-navigation">
    <li class="selected">
      <a href="#tab1">Tab Title 1</a>
    </li>
    <li>
      <a href="#tab2">Tab Title 2</a>
    </li>
  </ul>
  <div class="tab-container">
    <div id="tab1">
      <h3>Tab Title 1</h3>
      <p>Tab Content 1</p>
    </div>
    <div id="tab2" class="hidden">
      <h3>Tab Title 2</h3>
      <p>Tab Content 2</p>
    </div>
  </div>
</div>
```

And is initialized like so:
``` javascript
$(".tabs").wsol_tabs();
```

The plugin can also be removed afterwards:
``` javascript
$(".tabs").data("wsol.tabs").destroy();
```

Or manually changed to a specific tab (index or ID):
``` javascript
$(".tabs").data("wsol.tabs").changeTab(0);
```


### Configuring

The jQuery plugin supports a number of configuration options:

Option                      | Type     | Description                                                      | Default
----------------------------|----------|------------------------------------------------------------------|--------
`navigationLinkSelector`    | String   | Selector for tab navigation links                                | `> .tab-navigation > li > a`
`containerSelector`         | String   | Selector for tab containers                                      | `> .tab-container > div`
`selectedClass`             | String   | Class name to apply to the selected tab link                     | `selected`
`hiddenClass`               | String   | Class name to apply to non-selected tabs                         | `hidden`
`accordionHiddenClass`      | String   | Class name to apply to non-selected accordions                   | `accordion-hidden`
`autoScroll`                | Boolean  | Keep active tab/accordion in viewport on change                  | true

---
_Source: https://npm.io/package/@wearediagram/wsol.tabs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
