Framework Adapters
Framework Adapters
Section titled “Framework Adapters”Relaxicons generates idiomatic components for different ecosystems.
React (Vite / Next.js / RSC)
Section titled “React (Vite / Next.js / RSC)”- Functional component using JSX/TSX.
- Standard props:
size,color,strokeWidth,classNamewith defaults. - RSC-safe variant available via
--framework next-rsc. - Named export:
HomeIcon.
- Single File Component
<template>. - Binds
$attrsand mapssize,color,strokeWidth,class/className.
Angular
Section titled “Angular”- Standalone component with
@Componentdecorator. @Input()properties:size,color,strokeWidth,className.- Selector derived from kebab-case id:
icon-home.
Laravel (Blade)
Section titled “Laravel (Blade)”- Blade file with PHP variables for attributes.
- Include via
@include('icons.home').
Svelte
Section titled “Svelte”.sveltecomponent with exported propssize,color,strokeWidth,className.
- JSX component; props include
size,color,strokeWidth,classand are split/spread viasplitProps.
Web Components
Section titled “Web Components”- Custom element with Shadow DOM. Attributes:
size,color,stroke-width,class.
Raw SVG
Section titled “Raw SVG”Use --raw to write optimized SVG instead of a component wrapper.
relaxicons add lucide:home --rawAttribute Normalization
Section titled “Attribute Normalization”The transformer removes explicit width/height and sets fill/stroke to currentColor for easy theming.
Extensibility
Section titled “Extensibility”Custom templates: set templatesDir in relaxicons.config.json to point to your template directory. Supported engines: .hbs (Handlebars), .ejs (EJS), or .js (module exporting a function(context) => string). Files are resolved by framework id, e.g. react.hbs, vue.ejs, angular.js, webc.hbs.