
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
A simple and lightweight tab plugin
No dependencies.
The library is written in pure JavaScript and requires no additional dependencies.
Simplicity and functionality.
Easily integrate and use the library to implement essential tab functionality.
Accessibility.
The plugin follows all accessibility best practices.
CSS customization.
Modify the appearance and layout effortlessly using CSS.
dist
folder.npm i justtabs
<link rel="stylesheet" href="just-tabs.min.css">
<script src="just-tabs.min.js"></script>
Or (for module bundlers):
import 'justtabs/dist/just-tabs.min.css';
import JustTabs from 'just-tabs';
<div data-jtabs="tabs">
<ul data-jtabs="nav">
<li>
<button type="button"
data-jtabs="control">Tab 1</button>
</li>
<li>
<button type="button"
data-jtabs="control">Tab 2</button>
</li>
<li>
<button type="button"
data-jtabs="control">Tab 3</button>
</li>
</ul>
<div>
<div data-jtabs="panel">Content 1</div>
<div data-jtabs="panel">Content 2</div>
<div data-jtabs="panel">Content 3</div>
</div>
</div>
The
data-jtabs
attribute is essential for plugin functionality.
new JustTabs( 'tabs' );
The JustTabs constructor accepts two arguments:
startTabIndex
:new JustTabs( 'tabs', {
startTabIndex: 1
} );
switchTo
method (pass the target tab index):const tabs = new JustTabs( 'tabs' );
tabs.switchTo( 2 );
getOptions()
:const tabs = new JustTabs( 'tabs' );
tabs.getOptions(); // Returns full config object
tabs.getOptions('el'); // Returns the root HTML element
onInit
):new JustTabs( 'tabs', {
onInit: ( tabs ) => {
console.log( tabs );
}
} );
onSwitch
):new JustTabs( 'tabs', {
onSwitch: ( tabs ) => {
console.log( tabs );
}
} );
FAQs
A simple and lightweight tab plugin
We found that justtabs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.