Bootstrap
bootstrap (JS components) API Reference
Bootstrap 5 component JavaScript API — programmatic control of modal, tooltip, popover, and dropdown.
By EZ4Code Team
Components
Programmatic API for Bootstrap's JavaScript components. Each component is a class on the bootstrap namespace (e.g. bootstrap.Modal).
new bootstrap.Modal(element, options?)Creates a Modal instance for a modal element. Use show/hide/toggle to control it.
Returns: Modal
Component.getOrCreateInstance(element, options?)Static method that returns an existing component instance for the element, or creates a new one.
Returns: Component instance
instance.show() / .hide() / .toggle()Shows, hides, or toggles a component instance. Dispatches the corresponding before/after events.
Returns: void
instance.dispose()Destroys a component instance, removing its DOM artifacts and event listeners.
Returns: void
instance.update()Updates the position/content of a component (used by tooltip, popover, dropdown).
Returns: void