mdbootstrap/TW-Elements
29.4
Weak · 1 October 2026
7.3k
lines of production code
JavaScript
primary language
2
measurements over time
What this system is
TW Elements is a UI component library for Tailwind CSS that provides pre-styled form controls, animations, and interactive elements. It features an automatic initialization system based on HTML data attributes and includes utilities for accessibility, gesture detection, and DOM management. The library supports TypeScript and is distributed as an ES module with standard npm integration.
Features
Added TypeScript declaration for tw-elements module
A new TypeScript declaration file (types/tw-elements.d.ts) has been added to define the 'tw-elements' module, enabling proper type checking and IntelliSense support for consumers using TypeScript.
types · high confidence
Introduction of automatic component initialization system
The library now includes a new auto-initialization system that automatically detects and initializes components based on HTML data attributes (such as \data-twe-toggle\ and \data-twe-\*\ selectors). This system, located in \src/js/autoinit\, manages component registration to prevent duplicate initializations, handles specific interaction callbacks for togglers like dropdowns, modals, and tabs, and ensures compatibility with jQuery if it is present in the project.
src/js/autoinit · high confidence
TW Elements v2.0.0 release with Tailwind CSS integration
The project has been rebranded from 'perfect-scrollbar' to 'TW Elements' (version 2.0.0), shifting from a jQuery scrollbar plugin to a comprehensive UI component library for Tailwind CSS. This release introduces a new Tailwind CSS plugin (\plugin.cjs\) that provides extensive styling for form controls (like range inputs), shadows, and animations, alongside a new \index.html\ demo page that loads the library via CDN. The repository also now includes a Contributor License Agreement bot configuration (\.clabot\) and a standard Code of Conduct.
(repo-wide) · high confidence
Behavioural changes
New utility modules for UI behavior and accessibility
The \src/js/util\ directory has been refactored to include a suite of new utility classes that enhance component behavior and accessibility. This introduces a \Backdrop\ utility that manages overlay elements with customizable CSS classes and click callbacks, a \FocusTrap\ utility to enforce keyboard navigation within specific elements, and a \ScrollBarHelper\ to manage body overflow and padding when modals or off-canvas menus are open. Additionally, new \Touch\ and \Swipe\ utilities provide gesture detection support, while a \sanitizeHtml\ function adds robust HTML sanitization with configurable allowlists to prevent XSS vulnerabilities. Other utilities include \Stack\ for z-index management, \addPerfectScrollbarStyles\ for custom scrollbar styling, and \component-functions\ for enabling dismiss triggers.
src/js/util · high confidence
Refactored DOM utilities and component base architecture
The library has restructured its internal DOM handling by introducing dedicated modules for data storage (\data.js\), event management (\event-handler.js\), and DOM manipulation (\manipulator.js\), alongside a new \base-component.js\ that standardizes instance lifecycle and data association. This refactor updates how component data is attached to elements and how events are delegated and normalized, providing a more robust foundation for the existing UI components like Modal, Dropdown, and Tooltip.
src/js/dom · high confidence
Updated to TW Elements 2.0.0
The project has upgraded to TW Elements version 2.0.0, replacing the previous CSS bundle with a new minified stylesheet. This update brings changes to the underlying styling, including updated Tailwind CSS utilities and component styles, which may affect the visual appearance and layout of the application.
(repo-wide) · high confidence
Dependencies
Initial package.json for TW-Elements v2.0.0
The project now includes a package.json defining the TW-Elements library at version 2.0.0. This configuration establishes the package as an ES module ('type': 'module') and specifies entry points for styles (CSS and SCSS), the main UMD bundle, the ES module bundle, and TypeScript type definitions, enabling standard npm installation and usage.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 29 → 29 (+0.9)
- Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 33 → 33 (-0.6)
- Architecture 100 → 87 (-12.9)
- Maturity 36 → 36 (-0.8)
- Readiness 9 → 12 (+3.4)
- Security 81 → 81 (+0.0)
- Accessibility 68 → 66 (-1.6)
Resolved (1)
- Documentation: no usage examples (README.md)
New (5)
- FileTooLong: plugin.cjs (plugin.cjs)
- Low cohesion: Carousel (LCOM4 5) (src/js/free/components/carousel.js)
- Low cohesion: Modal (LCOM4 4) (src/js/free/components/modal.js)
- Low cohesion: ScrollSpy (LCOM4 4) (src/js/free/navigation/scrollspy.js)
- Projects may be oversized for their cohesion
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mdbootstrap/TW-Elements was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 9b442c410d8de1c44fbad6728668235c36c4b712 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.