kotaindah5515 downloadsInject additional mainstream icons from Lucide and Lucide Lab.
Inject additional mainstream icons from Lucide and Lucide Lab to Obsidian.
Obsidian already ships most of Lucide icons to its app. Although, It's still missing latest mainstream icons from Lucide such as list-clock () and
user-group () icons. That's why Mainstream Icons was created to address that lack of things by injecting latest mainstream icons to the core of the Obsidian app.
[!NOTE]
Please note that this plugin is not intended to customize icons on its own. Rather, it merely provides additional icons for use by Obsidian and other plugins.
Example using Note Toolbar plugin:
| Plugin disabled | Plugin enabled |
|---|---|
To insert additional icon, you can use the same method as inserting icon using getIcon() or setIcon():
import { getIcon, setIcon } from 'obsidian';
// Get icon svg and insert it
let iconEl = createDiv();
let iconSvg = getIcon('lucide-user-group');
if (iconSvg) iconEl.append(iconSvg);
// Or, insert it immediately
let anotherIconEl = createDiv();
setIcon(anotherIconEl, 'lucide-user-group');
But, why don't we use addIcon() to extend existing icons? Indeed, Obsidian already provides us that function as a solution to use external icons as we want. Although, Obsidian will automatically set the view box of the SVG element to 0 0 100 100 (i.e. wrapped in just <svg viewBox="0 0 100 100">...</svg>), while Obsidian treats internal icons differently (by wrapping them in <svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor">...</svg>).
It's not a really big deal though. However, especially for me who want to achieve consistency, it can be a little frustating sometimes.
mainstream-icons under YOUR_VAULT_NAME/.obsidian/plugins.manifest.json, main.js, and style.css from the latest release into the folder.Lucide is a trademark of Lucide Icons, which is licensed under MIT. This plugin is not affiliated with or endorsed by Lucide Icons.