API Reference
@themvora/shadcn · Svelte
shadcn/ui adapter: token variables plus framework bindings for React, Vue, Svelte, Solid and Angular.
useShadcnTheme(runtime, options?) installs the shadcn adapter onto an
explicitly provided Themvora runtime and disposes it on unmount.
Generated from
packages/shadcn/srcbyapps/docs/scripts/generate-api-reference.mjs. Do not edit by hand — runpnpm --filter @themvora/docs api:generate.
Functions
useShadcnTheme<T extends ThemeDefinition<string>>(runtime, options): ThemeAdapter<T>
Svelte composable that installs the shadcn/ui adapter onto the given Theme
Kit runtime. Maintains a tagged :root style element with concrete --*
variables, kept in sync as the active theme changes.
Must be called during component initialization, passing the runtime from
your Themvora provider (e.g. getThemeRuntime() from @themvora/svelte):
import { useShadcnTheme } from "@themvora/shadcn/svelte";
useShadcnTheme(runtime);The adapter installs synchronously (guarded on window, so it is SSR-safe)
and is disposed via Svelte's effect tree.
See also: createShadcnAdapter
| Parameter | Type | Description |
|---|---|---|
runtime | ThemeRuntime<T> | The active Themvora runtime to install the adapter on. |
options | UseAdapterOptions | Adapter options. Defaults to {}. |
Returns ThemeAdapter<T> — The installed adapter instance.
Interfaces
UseAdapterOptions
Options accepted by the Svelte adapter composables (e.g. useShadcnTheme).
| Member | Type | Description |
|---|---|---|
strategy (optional) | AdapterStrategy | The adapter strategy to use. When omitted, the adapter's default strategy applies. |
Related docs
- shadcn/ui — the adapter integration