API Reference
@themvora/bootstrap · Factory
Bootstrap adapter: concrete --bs-* variables (including -rgb triplets) kept in sync with the runtime.
Functions
createBootstrapAdapter<T extends ThemeDefinition<string>>(options): ThemeAdapter<T>
Creates a Bootstrap adapter.
The adapter is a DOM-only, framework-free adapter: it depends only on
@themvora/core and the DOM. On install it injects the Bootstrap
compatibility stylesheet (when enabled) and a <style> element of CSS
variables derived from the active theme, then subscribes to the runtime
store and rewrites the variables whenever the theme selection changes. It
does not render any component or require a React tree.
On uninstall it removes the injected styles and unsubscribes from the store.
See also: useBootstrapTheme
| Parameter | Type | Description |
|---|---|---|
options | CreateBootstrapAdapterOptions | Adapter options. Defaults to {}. |
Returns ThemeAdapter<T> — A ThemeAdapter for Bootstrap.
import { createBootstrapAdapter } from "@themvora/bootstrap";
runtime.adapters.use(createBootstrapAdapter());Interfaces
BootstrapAdapterOptions
Options for the Bootstrap adapter.
See also: createBootstrapAdapter
| Member | Type | Description |
|---|---|---|
injectCSS (optional) | boolean | Whether to inject the Bootstrap compatibility stylesheet. Defaults to true. |
strategy (optional) | AdapterStrategy | How faithfully the adapter reproduces Bootstrap's native feel. |
CreateBootstrapAdapterOptions
Extends BootstrapAdapterOptions
Options for createBootstrapAdapter.
See also: createBootstrapAdapter
| Member | Type | Description |
|---|---|---|
injectCSS (optional) | boolean | Whether to inject the Bootstrap compatibility stylesheet. Defaults to true. |
plugins (optional) | AdapterPlugin[] | Adapter plugins that customize how the Bootstrap CSS variables are generated. Defaults to no plugins. |
strategy (optional) | AdapterStrategy | How faithfully the adapter reproduces Bootstrap's native feel. |
Related docs
- Bootstrap — the adapter integration