Composable chat message primitives for Svelte with markdown responses, attachments, branching, and action slots.
Svelte is a frontend framework used to build fast web applications and user interfaces.
Unlike frameworks like React or Vue.js, Svelte shifts most of the work to the build step instead of doing it in the browser at runtime.
That means:
- smaller bundle sizes
- faster websites
- less boilerplate code
- simpler reactivity
Simple Example
Counter Example
When you click the button, the UI updates automatically.
No setState, hooks, or complex state management needed.
Reactive Example
$: means “rerun this whenever dependencies change”.
If price or quantity changes, total updates automatically.
Conditional Rendering
Loop Example
Component Example
Button.svelte
Usage
Why Developers Like Svelte
- Very readable syntax
- Less code compared to React
- Built-in animations/transitions
- Great performance
- Excellent developer experience
- Easy state management
Real Projects Built With Svelte
- dashboards
- AI chat apps
- landing pages
- blogs
- animations
- design systems
- browser extensions
Since you already work with Svelte, many of your projects like:
- Svelte AI Elements
- Svelte Animations
- Svelte Marketing Blocks
are examples of real-world Svelte ecosystems.
Installation
Composition
Copy the Source Code
Copy and paste the following code into your project:
Examples
File Attachment Example
I can review both:
- Click the image tile to open the centered preview dialog
- Non-image files stay compact and tooltip-based
- You can add
onRemovewhen attachments should be dismissible
Branch Message Example
Option 1
Keep it compact and composable. Use Message for layout, MessageContent for a single body, and MessageToolbar only when the message needs controls.