swyxio / swyxkit

An opinionated blog starter for SvelteKit + Tailwind + Netlify. Refreshed for SvelteKit 1.0!
https://swyxkit.netlify.app/
MIT License
675 stars 88 forks source link

Adding a Histoire "Storybook" to Swyxkit #126

Closed swyxio closed 1 year ago

swyxio commented 1 year ago

tags: histoire, dx

As of https://github.com/sw-yx/swyxkit/pull/113, Swyxkit now comes with a "Storybook" out of the box. We chose Histoire for now. Thats the TLDR.


When you run npm start, you get both SvelteKit, and a Histoire instance running alongside:

image

image

The story authoring process currently uses a .story.svelte format, which means you have to write .story.md files separately for docs. We are currently discussing how best to improve this.

Why add a Design System Sandbox?

The best way to prototype new components is in isolation, and you should have some knobs to play around with them as well as be able to resize them to see how they behave responsively.

This does of course add weight to the swyxkit installation, but my subjective judgment is that:

These are the main decision criteria for adding.

Why Histoire?

Storybook is the 800 pound gorilla in this space, but requires config for a separate Webpack toolchain.

There are a number of Vite-native Storybook killers:

All are at very early stages so it is hard to say who to bet on. But I subjectively liked @Akryum's design and OSS maintenance skills so I went with Histoire for now.