
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
drag-tabs
Advanced tools
As of version
1.0.0this library exposes ES modules. Use an ES module aware transpiler such as Webpack, Rollup or Browserify + babelify to bundle it for the browser.
A tiny utility that makes tabs inside a container draggable.
drag, start, cancel and end eventsGiven you got an element with the following HTML markup:
var $el = (
<div>
<ul class="my-tabs-container">
<li class="my-tab"></li>
<li class="my-tab"></li>
<li class="my-tab ignore-me"></li>
</ul>
</div>
);
Create the dragger:
var dragger = dragTabs($el, {
selectors: {
tabsContainer: '.my-tabs-container',
tab: '.my-tab',
ignore: '.ignore-me'
}
});
Listen to drag events emitted via the DragTabs instance and use the updates to move the tabs to the appropriate position:
dragger.on('drag', function(context) {
var dragTab = context.dragTab,
newIdx = context.newIdx;
// move the tab to the new position
});
// move the tab to the initial position
dragger.on('cancel', function(context) {});
The DragTabs instance is an event emitter that fires the following events:
start: tab dragging startsdrag: fired on every position updateend: always fired at the end of the dragcancel: only fired when the dragging is canceledThe events drag, end and cancel are emitted with the following context:
{
dragTab: {HTMLElement},
newIndex: {Number}
}
The event start is fired with the following context:
{
dragTab: {HTMLElement},
initialIndex: {Number}
}
To trigger a manual update on the DragTabs instance, i.e. because the displayed tabs change call DragTabs#update:
dragger.update();
npm run test
MIT
FAQs
A tab dragging component
The npm package drag-tabs receives a total of 340 weekly downloads. As such, drag-tabs popularity was classified as not popular.
We found that drag-tabs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.