Skip to content

Framework Adapters

Relaxicons generates idiomatic components for different ecosystems.

  • Functional component using JSX/TSX.
  • Standard props: size, color, strokeWidth, className with defaults.
  • RSC-safe variant available via --framework next-rsc.
  • Named export: HomeIcon.
  • Single File Component <template>.
  • Binds $attrs and maps size, color, strokeWidth, class/className.
  • Standalone component with @Component decorator.
  • @Input() properties: size, color, strokeWidth, className.
  • Selector derived from kebab-case id: icon-home.
  • Blade file with PHP variables for attributes.
  • Include via @include('icons.home').
  • .svelte component with exported props size, color, strokeWidth, className.
  • JSX component; props include size, color, strokeWidth, class and are split/spread via splitProps.
  • Custom element with Shadow DOM. Attributes: size, color, stroke-width, class.

Use --raw to write optimized SVG instead of a component wrapper.

Terminal window
relaxicons add lucide:home --raw

The transformer removes explicit width/height and sets fill/stroke to currentColor for easy theming.

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.