2021-11-01
2739
#svelte
Madushika Perera
74759
Nov 1, 2021 â‹… 9 min read

Build your own component library with Svelte

Madushika Perera Software Engineer at FusionGrove

Recent posts:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 â‹… 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 min read
View all posts

2 Replies to "Build your own component library with Svelte"

  1. Nice article! I really enjoy writing apps using Svelte, it so simple and yet so powerful. I really hope it to take React’s place as the main Javascript frontend framework in the next years. Happy 2022 from Brazil!

  2. Madushika this is an excellent, thorough and well-written article on a topic dear to my heart! I’m creator of AgnosticUI — https://www.agnosticui.com/ and one of the frameworks it supports is Svelte! I have had a rocky time with figuring out how to get Storybook to work for each framework and with Svelte I find the more complex cases especially when named slots are involved is to just create intermediary “example components” and then write the Storybook stories against those. You can see what I mean if you find my repo but I believe it’s actually what they recommend (when you use the little framework selector on their articles for Svelte it always seems to show using this approach).

    I have also found Parcel to be useful for writing the HTML/CSS and AgnosticUI’s CSS package uses that. But you can see the https://designsystem.digital.gov/ as a great example as that’s where I learned of it and they push Parcel much harder then I do 🙂

    I wrote my blog developtodesign.com in Sapper and now wish I had Svelte Kit at the time. Most likely I will not find time to redo it soon, but I’m certainly keen to find opportunities to incorporate SvelteKit. I wondered if I needed to port the Svelte workspace in AgnosticUI to it but it doesn’t seem necessary from what you’ve written—it seems more akin to Sapper was and since I’m generating a library I think straight-up Svelte with rollup is fine.

    One thing I’ve found very hard to figure out is how to get UMD builds to work properly. If you have any luck further down the road I will definitely read and listen! Thanks for your nice article here!

Leave a Reply