0.3.4 • Published 4 months ago

luna-tab v0.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Luna Tab

Easy tabs.

Demo

https://luna.liriliri.io/?path=/story/tab

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-tab/luna-tab.css" />
<script src="//cdn.jsdelivr.net/npm/luna-tab/luna-tab.js"></script>

You can also get it on npm.

npm install luna-tab --save
import 'luna-tab/luna-tab.css'
import LunaTab from 'luna-tab'

Usage

const container = document.getElementById('container')
const tab = new LunaTabs(container, {
  height: 30,
})
tab.append({
  id: 'console',
  title: 'Console',
})
tab.select('console')
tab.on('select', id => {
  console.log(id)
})

Configuration

  • height(number): Tab height.

Api

append(tab: ITab): void

Append tab.

deselect(): void

Deselect tabs.

insert(pos: number, tab: ITab): void

Insert tab at given position.

remove(id: string): void

Remove tab.

select(id: string): void

Select tab.

Types

ITab

  • id(string): Tab id.
  • title(string): Tab title.
0.3.4

4 months ago

0.3.3

4 months ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago