Compare
Pick a feature to read its React, Vue, and Svelte implementations side-by-side. Each page shows the actual source files used by the live shop, highlighted with Shiki.
-
Slide banner
Timers + cleanupA setInterval that has to be torn down on unmount. The contrast is in how each framework expresses "do this on mount, undo it on unmount".
-
Product carousel
DOM refsCapture a DOM element from the template so the prev/next buttons can call scrollBy() on it.
-
Product list
Async fetch + derived stateFetch on mount, render a loading/error/list state machine, and derive a filtered view from a search query.
-
Add to cart button
Events + global store subscriptionEach button reads the same nanostore to know how many of this product are already in the cart, and writes to it on click.
-
Cart badge
Read-only global stateThe smallest possible store consumer. Subscribes to a computed total and renders it.
-
Quantity stepper
Two-way bindingBind an input to a store value, with deferred commit on blur/Enter so backspacing through the number does not delete the cart row.
-
Cart view
List rendering + compositionIterates over the cart items and embeds the same-framework QuantityStepper for each row.
-
Product detail
Local UI state + nested data renderingImage gallery with selected-index local state, plus a reviews list with star ratings. The reviews loop is a small showcase of nested data rendering, and the star widget is reused both for the product rating and per-review rating.
-
Checkout form
Forms + validation + radio groupsSeven fields including a phone number and a shipping radio group, all validated. Live order summary derives subtotal from the cart store, looks up the selected shipping option, and surfaces a free-shipping threshold. Submit is gated until everything is valid; success replaces the form inline.
-
Wishlist toggle
Local UI state + persistent global storeA heart-shaped toggle on each product card that persists across sessions. The button reads "is this in the wishlist?" from a derived value and toggles the entry on click — same shape as the cart, but the store is a Set-of-ids and the state read is a boolean.
-
useCart — hook / composable / rune function
Logic composition (reusable reactive logic)Cart subtotal lookup is needed in both CartView and CheckoutForm. Each framework has its own pattern for extracting reactive logic into a reusable function — different name, same idea. The three live in src/hooks, src/composables, and src/lib so they read like real-world code rather than demo files.
-
Toast notifications
Composition (children / slot / snippet)A reusable Toast wrapper that takes arbitrary content. The Toaster fires one for every add-to-cart and wishlist toggle. The interesting comparison is how each framework lets a parent pass markup into a child slot.