tabinx
v0.0.2
Published
Tab Index Focus
Readme
Tabinx
A TypeScript library for handling the tabindex of your elements.
Features
- ✅ Multiple Build Formats - TypeScript, ES Modules, and CommonJS
- ✅ Type Safety - Full TypeScript support
Installation
npm install tabinxUsage Examples
Basic Usage
<div data-tabinx-container>
<input data-tabinx-selector="input1" />
<input data-tabinx-selector="input2" />
<button data-tabinx-selector="button1" />
</div>import { Tabinx } from 'tabinx';
const tabinx = new Tabinx();
tabinx.init({
selectors: ['input1', 'input2', 'button1'],
});Note:
- The selectors are in order from top to bottom.
- You should adjust the element's style to clearly see the focus effect.
API Reference
init()- Initialize the Tabinx classrefreshIndexes()- Update indexes when dynamic data changesresetCurrentIndex()- Reset currentIndex to 0getCurrentIndex()- Get currentIndex
Build Configuration
The library is built into 3 formats: cjs, mjs, d.ts
Build Commands
# Build all formats
npm run build
# Development mode
npm run dev
# Test build structure
npm run test