API Reference
@themvora/bootstrap
Bootstrap adapter: concrete --bs-* variables (including -rgb triplets) kept in sync with the runtime.
Exports the React-free createBootstrapAdapter factory (also available from
@themvora/bootstrap/factory), the createBootstrapVariables generator,
and the injectBootstrapCSS helper. Framework wrappers live on their own
subpaths: useBootstrapTheme(runtime) on @themvora/bootstrap/react, and
equivalent composables/injectables on /vue, /svelte, /solid, and
/angular.
Generated from
packages/bootstrap/srcbyapps/docs/scripts/generate-api-reference.mjs. Do not edit by hand — runpnpm --filter @themvora/docs api:generate.
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());createBootstrapVariables(tokens): Record<string, string>
Programmatic alternative to bootstrap.css. Returns concrete Bootstrap 5
CSS variable values — including -rgb companion variables that plain CSS
cannot derive.
| Parameter | Type | Description |
|---|---|---|
tokens | ThemeTokens | — |
Returns Record<string, string>
injectBootstrapCSS(): void
Injects the Bootstrap compatibility CSS (idempotent, SSR-safe). Called
automatically the first time useBootstrapTheme installs an adapter.
Returns void
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