Lucide icons for VanJS.
Powered by:
- Vite for tooling
- Vite-Plugin-VanJS for SSR support (the demo)
- Vitest for unit tests
- TailwindCSS for demo styling
Install with npm:
npm install vanjs-lucideInstall with pnpm:
pnpm add vanjs-lucideInstall with bun:
bun add vanjs-lucideInstall with deno:
deno add npm:vanjs-lucideBasic Usage You can call any icon(s) within your VanJS app:
import van from "vanjs-core";
import { Activity } from "vanjs-lucide";
const { main } = van.tags;
const App = () => {
return main({},
Activity({ class:"icon", style:"color: turquoise" });
);
};
van.add(document.body, App());JSX Usage When using vite-plugin-vanjs with JSX transformation enabled you can call any icon(s) within your VanJS app:
import van from "vanjs-core";
import { Activity } from "vanjs-lucide";
const App = () => {
return <main>
<Activity class="icon" style={{ color: "turquoise" }} />
</main>;
};
van.add(document.body, <App />);Notes
- All
SVGSVGElementattributes should be supported, even with reactive values; - Camel case attribute names are not supported and strongly discouraged (EG: use
"stroke-width"instead ofstrokeWidth); - Since the feather library adds color to icons via the
strokeproperty, any textcolorvalue inherited from parent elements would apply to your icons; - The
widthandheightproperties can change the scale of the icons, something you may not want when using customstyleand / orclass; - JSX transformation via vite-plugin-vanjs allows you to use
CSSStyleDeclarationlike objects for your icons and elements in general.
VanJS Lucide is released under the MIT License.
