tabler-icons icon indicating copy to clipboard operation
tabler-icons copied to clipboard

Export the SVG files

Open simontaisne opened this issue 3 years ago • 4 comments

What about exporting the SVG files in addition to the React components?

For those using Next.js with SVGR this would allow such usage with dynamic import.

const svg = {
  heart: dynamic<SVGProps<SVGSVGElement>>(() =>
    import('@tabler/icons/icons/heart.svg').then((mod) => mod.ReactComponent)
  ),
  ...
}

const Icon = ({ icon, ...props }) => {
  const Svg = svg[icon];

  return <Svg {...props} />;
};

simontaisne avatar Jul 07 '21 14:07 simontaisne

@codecalm any opinion?

simontaisne avatar Dec 12 '21 19:12 simontaisne

@simontaisne I want to separate Tabler packages into png, vue, react, etc. By the way I will also take care of this task :)

codecalm avatar Dec 13 '21 20:12 codecalm

Sounds great! Looking forward to it 💯

simontaisne avatar Dec 13 '21 21:12 simontaisne

@simontaisne we've added *.svg files do package.json config, can you try now? :)

codecalm avatar Jul 15 '22 08:07 codecalm

https://tabler.io/docs/icons/svelte

codecalm avatar Mar 11 '23 14:03 codecalm