bootstrap-component-js

Installation
SKILL.md

Bootstrap 6 component JavaScript

Every Bootstrap plugin is a TypeScript module in js/src/ that extends BaseComponent, which handles instance registration, config merging, and teardown. Follow the shared structure and a component gets getInstance(), getOrCreateInstance(), data-bs-* config, namespaced events, and dispose() without writing any of it.

The sources are TypeScript, but the runtime patterns are the same ones v5 used with types layered on top. Bootstrap compiles them to JavaScript and emits its own declarations, so consumers need no @types/bootstrap.

For the component's styles, see the bootstrap-component skill.

Workflow

  • Step 1: Scaffold the module
  • Step 2: Define config options
  • Step 3: Implement behavior and events
  • Step 4: Wire the data API
  • Step 5: Position with Floating UI (optional)
  • Step 6: Wrap a third-party library (optional)
  • Step 7: Clean up in dispose()
  • Step 8: Register and test
  • Step 9: Verify
Installs
109
Repository
twbs/bootstrap
GitHub Stars
174.8K
First Seen
Aug 27, 2026