# tab-manager

> A node.js module to create tabs with ease.

Latest version **1.0.11** (published 2015-12-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install tab-manager
pnpm add tab-manager
yarn add tab-manager
bun add tab-manager
```

## 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 | 1.0.11 |
| Published | 2015-12-04 |
| First published | 2015-11-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jochen Bernard |
| Maintainers | jochebe |
| Keywords | node, tabs, easy |

## Links

- npm: https://www.npmjs.com/package/tab-manager
- Repository: https://github.com/JocheBe/tab-manager
- Homepage: https://github.com/JocheBe/tab-manager#readme
- Issues: https://github.com/JocheBe/tab-manager/issues
- npm.io page: https://npm.io/package/tab-manager

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) ^2.1.4

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2015-12-04
- 1.0.10 — 2015-12-03
- 1.0.9 — 2015-12-01
- 1.0.8 — 2015-11-30
- 1.0.7 — 2015-11-30
- 1.0.6 — 2015-11-30
- 1.0.5 — 2015-11-30
- 1.0.4 — 2015-11-29
- 1.0.3 — 2015-11-29
- 1.0.2 — 2015-11-29
- 1.0.1 — 2015-11-29
- 1.0.0 — 2015-11-29

## README

<p align="center"><img src="http://i.imgur.com/uEY2zi4.png" width="256" /></p>

<p align="center">A node.js module to create tabs with ease.</p>

# Installation

To install tab-manager globally on your computer just open terminal and run:

```
$ npm install tab-manager
```

<br/>

To install it in a directory (recommended) run:

```
$ npm install --save tab-manager
```

# How to use

## The basics

### Inside the html

To create a button for a tab just use an element with the class "tabbutton" like so:

```html
<button class="tabbutton">Tab 1</button>
<button class="tabbutton">Tab 2</button>
```

<br/>

To create the tab itself just use an element with the class "tabscreen" like so:

```html
<div class="tabscreen">This is tab 1!</div>
<div class="tabscreen">This is tab 2!</div>
```

<br/>

Finally to link a button to a tab you can give them an attribute "screen" with the same value.

The final result:

```html
<button class="tabbutton" screen="first">Tab 1</button>
<button class="tabbutton" screen="second">Tab 2</button>

<div class="tabscreen" screen="first">This is tab 1!</div>
<div class="tabscreen" screen="second">This is tab 2!</div>
```

### Inside the JavaScript

This is the easiest just connect a Javascript file to your html file or use the "script" tag.

Inside the JavaScript just require "tab-manager" and let it watch like this:

```javascript
var tabManager = require("tab-manager");

tabManager.watch();
```

**Done!**

## Further features

You can set a default tab that should be open when the page loads by giving the button the class "selected":

```html
<button class="tabbutton selected" screen="first">Tab 1</button>
```

*! If this is not given all tabs will be hidden until a tab button is clicked !*

<br/>

You can create a different style for tab-buttons when the tabs are open.
tab-manager automatically gives a tab-button the class "selected" when the tab is open so it is easy to style in css:

```css
.tabbutton.selected {
  text-decoration: underline;
}
```

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