LiveSvelte Examples
++ Explore these examples to learn how to integrate Svelte components with Phoenix LiveView. +
++ 1 + Basics +
+-
+
- + Hello World + - Simple component rendering + +
- + Lodash + - Using npm packages + +
- + Struct Props + - Passing Elixir structs as props + +
+ 2 + Interactive +
+-
+
- + Counter + - Server + client state + +
- + Lights + - Multiple components sharing state + +
- + Sigil + - Inline Svelte with ~V sigil + +
- + Plus/Minus (Static) + - Dead view integration + +
- + Plus/Minus (Live) + - LiveView integration + +
- + Hybrid Counter + - Client + server events + +
+ 3 + Data +
+-
+
- + Log List + - Dynamic list updates + +
- + Breaking News + - Real-time updates with ~V sigil + +
- + Chat + - PubSub + pushEvent + +
- + LiveJSON + - Efficient JSON diffing + +
+ 4 + Slots +
+-
+
- + Simple Slots + - Basic slot usage + +
- + Dynamic Slots + - Named slots with dynamic content + +
+ 5 + Advanced +
+-
+
- + Client Loading + - Loading states and SSR + +
+ 6 + Ecto +
+-
+
- + Notes (OTP JSON) + - Default OTP encoder with SQLite + +
- + Notes (Jason) + - Jason-compatible approach + +
+ View the source code on + GitHub +
+