Build an icon component library for React with SVGR and Rollup

Поделиться
HTML-код
  • Опубликовано: 6 июн 2024
  • Learn how to build your own SVG icon component library for React! In this video, we use SVGR and Rollup to make a publishable NPM package, with components generated directly from your SVG files.
    Code: github.com/mryechkin/acme-icons
    Timestamps:
    00:00 Intro
    00:20 Project Setup
    01:04 SVGR Overview
    01:43 Adding SVGR
    05:59 Rollup / Plugins Overview
    07:46 Adding Rollup
    08:12 Rollup Config
    10:17 Babel Plugins
    11:20 Babel Presets
    12:15 Updating NPM Scripts
    13:54 Adding Babel Config
    16:14 Rollup Filesize Plugin
    17:35 Using The Bundle In An App
    GitHub: github.com/mryechkin
    Twitter: / mryechkin
  • НаукаНаука

Комментарии • 19

  • @Uma-ol6rh
    @Uma-ol6rh 3 года назад +1

    I followed along and used my own SVG images, it works great locally. Thank you, awesome tutorial.

  • @HeyNoah
    @HeyNoah Год назад

    Exactly what I was looking for! Love your videos man! Thanks so much!

  • @pedroserapio8075
    @pedroserapio8075 2 года назад

    Very well explained. Thank you for pointing out the Babel setup, usually not simple to understand.

  • @flightstreamer
    @flightstreamer 3 года назад

    Awesome! Thanks for a great tutorial once again! 😀

  • @phanirajk9144
    @phanirajk9144 3 года назад

    Great tutorial.
    Looking forward for more.

  • @alexanderbartolo444
    @alexanderbartolo444 Год назад

    This is great, thank you for the detailed explanation.

  • @carolineroy8009
    @carolineroy8009 2 года назад

    Super nice tutorial ! I hope you'll publish new videos in the future, love your content 🥺

  • @EzequielGarraffo
    @EzequielGarraffo 2 года назад

    I have no words to thank you. This solved my problem with svgs and rollup.
    Fantastic tutorial. Subscribed and liked.

    • @mryechkin
      @mryechkin  2 года назад +1

      Glad to hear that! Thank you :)

  • @rmjwilbur
    @rmjwilbur Год назад

    Thanks, looks just like what I was after

  • @PabloRodriguez-hc4wd
    @PabloRodriguez-hc4wd 2 года назад

    Awesome!!! Which rollup config dou you recomend to generate .js n.esm and ts?

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 года назад

    Awesome Tutorial +++++++++++++++++ Thank You

  • @vedbhanushali608
    @vedbhanushali608 5 месяцев назад

    thanks

  • @ericsonl_
    @ericsonl_ Год назад +1

    Hey it's there a way to warp it as props from Icon component like using it with button for example `...` or ``

  • @rudzkygen
    @rudzkygen 8 месяцев назад

    Is there an option to add dynamic import for there icons? Something similar to Lucide Icons

  • @brindch8372
    @brindch8372 Год назад

    Great work! how about creating a component library that is using material-ui?

  • @withAsim
    @withAsim 2 года назад

    Hi, I want to use (.jsx) files rather than (.js) how can I use it because I am facing an error in the build.

  • @pixelbakery
    @pixelbakery 2 года назад +1

    Hi, any advice on how to use SVGR with Vite/React/Tailwind?

    • @mryechkin
      @mryechkin  2 года назад

      Great question! You can use their Rollup plugin in Vite. I made a sample repo for reference: github.com/mryechkin/vite-svgr