API Reference
@themvora/daisyui
daisyUI adapter: theme variables mapped onto daisyUI's CSS variable contract.
Exports the React-free createDaisyAdapter factory (also available from
@themvora/daisyui/factory), the createDaisyVariables generator, and the
injectDaisyCSS helper. Framework wrappers live on their own subpaths:
useDaisyTheme(runtime) on @themvora/daisyui/react, and equivalent
composables/injectables on /vue, /svelte, /solid, and /angular.
Generated from
packages/daisyui/srcbyapps/docs/scripts/generate-api-reference.mjs. Do not edit by hand — runpnpm --filter @themvora/docs api:generate.
Functions
createDaisyAdapter<T extends ThemeDefinition<string>>(options): ThemeAdapter<T>
Creates a daisyUI adapter.
The adapter is a DOM-only, framework-free adapter: it depends only on
@themvora/core and the DOM. On install it injects the daisyUI
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: useDaisyTheme
| Parameter | Type | Description |
|---|---|---|
options | CreateDaisyAdapterOptions | Adapter options. Defaults to {}. |
Returns ThemeAdapter<T> — A ThemeAdapter for daisyUI.
import { createDaisyAdapter } from "@themvora/daisyui";
runtime.adapters.use(createDaisyAdapter());createDaisyVariables(tokens): Record<string, string>
Programmatic alternative to daisyui.css. Returns concrete daisyUI 5 CSS
variable values for a given set of Themvora tokens.
| Parameter | Type | Description |
|---|---|---|
tokens | ThemeTokens | — |
Returns Record<string, string>
injectDaisyCSS(): void
Injects the daisyUI compatibility CSS (idempotent, SSR-safe). Called
automatically the first time useDaisyTheme installs an adapter.
Returns void
Interfaces
CreateDaisyAdapterOptions
Extends DaisyAdapterOptions
Options for createDaisyAdapter.
See also: createDaisyAdapter
| Member | Type | Description |
|---|---|---|
injectCSS (optional) | boolean | Whether to inject the daisyUI compatibility stylesheet. Defaults to true. |
plugins (optional) | AdapterPlugin[] | Adapter plugins that customize how the daisyUI CSS variables are generated. Defaults to no plugins. |
strategy (optional) | AdapterStrategy | How faithfully the adapter reproduces daisyUI's native feel. |
DaisyAdapterOptions
Options for the daisyUI adapter.
See also: createDaisyAdapter
| Member | Type | Description |
|---|---|---|
injectCSS (optional) | boolean | Whether to inject the daisyUI compatibility stylesheet. Defaults to true. |
strategy (optional) | AdapterStrategy | How faithfully the adapter reproduces daisyUI's native feel. |
Related docs
- daisyUI — the adapter integration