ThemeManager
Using the ThemeManager addon to manage themes in Obsidian
What is the ThemeManager?
The ThemeManager addon ships with a library of built-in color schemes and helper utilities to create, persist and reuse custom themes for your Obsidian UI.
Quick Start
Add the ThemeManager alongside your library and attach it to a tab or groupbox so users can tweak colors on the fly:
Built-In Themes
ThemeManager.BuiltInThemes exposes packaged schemes such as Default, BBot, Fatality, Nord, Dracula, Catppuccin and more. These are available instantly from the “Theme list” dropdown created by ApplyToTab.
API Reference
Methods
SetLibrary
Registers the UI library instance so ThemeManager can read and update color pickers.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Library to use for the ThemeManager | Library (table) | nil |
SetFolder
Overrides the base folder used to store theme JSON files and default markers.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Folder path relative to workspace | string | "ObsidianLibSettings" |
ApplyTheme
Applies either a built-in theme or a custom theme saved on disk.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Theme name (built-in or custom) | string | nil |
ThemeUpdate
Pushes the current picker values back into the library scheme. Automatically called when color pickers change, but exposed if you need to trigger it manually.
GetCustomTheme
Loads a custom theme JSON file and returns the decoded table.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Theme file name without extension | string | nil |
Returns table?; nil when the file does not exist or cannot be decoded.
LoadDefault
Reads the saved default marker and applies the relevant theme (built-in or custom).
SaveDefault
Stores the provided theme name as the default choice for future sessions.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Theme name to persist | string | nil |
SetDefaultTheme
Replaces the built-in Default theme with custom color definitions before rendering the UI. Call this before ApplyToTab.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Table containing FontColor, MainColor, AccentColor, BackgroundColor, OutlineColor, FontFace | table | nil |
SaveCustomTheme
Serializes the current picker values to <folder>/themes/<name>.json.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Theme name without file extension | string | nil |
Delete
Removes a saved custom theme file from disk.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Theme name without file extension | string | nil |
Returns boolean, string? describing the result.
ReloadCustomThemes
Re-scans the theme directory and returns a list of custom theme names.
Returns { string } of theme names.
CreateThemeManager
Builds the ThemeManager controls inside a provided groupbox (color pickers, dropdowns and action buttons).
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Groupbox returned by AddLeftGroupbox/AddRightGroupbox | Groupbox (table) | nil |
CreateGroupBox
Helper that creates the standard “Themes” groupbox on the left side of a tab.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Tab returned by Window:AddTab | Tab (table) | nil |
Returns the created groupbox so you can customize it further before calling CreateThemeManager.
ApplyToTab
Creates a groupbox within the tab and installs the ThemeManager UI into it.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Tab returned by Window:AddTab | Tab (table) | nil |
ApplyToGroupbox
Installs the ThemeManager UI into an existing groupbox.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Groupbox to populate | Groupbox (table) | nil |