Prerequisites
Before installing Better Svelte Email, ensure you have:- Svelte >= v5.14.3
- Node.js >= 18 (recommended)
- A Svelte or SvelteKit project set up
Better Svelte Email requires Svelte 5.14.3 or higher. For older versions of Svelte, use
svelte-email-tailwind instead.Install the Package
Install Better Svelte Email using your preferred package manager:Optional Dependencies
Better Svelte Email has several optional dependencies that enable additional features:Email Preview Component
For the built-in email preview component:Sending Emails with Resend
If you’re using Resend to send emails:Code Formatting
For prettier HTML output:Tailwind CSS Setup
While Better Svelte Email works without Tailwind CSS, you’ll get the best experience using Tailwind v4.Install Tailwind CSS v4
Configure Tailwind (Optional)
Better Svelte Email automatically processes Tailwind classes. No additional configuration is required unless you want to use custom Tailwind settings in your emails.Peer Dependencies
Better Svelte Email requires these peer dependencies (likely already installed in your project):svelte>= 5.14.3@sveltejs/kit>= 2 (optional, only needed if using SvelteKit features)
Verify Installation
Verify your installation by creating a simple test email:TypeScript Support
Better Svelte Email is written in TypeScript and includes comprehensive type definitions out of the box. No additional setup is required. All components and APIs are fully typed:Package Exports
Better Svelte Email provides several entry points for different use cases:Main Package
Individual Components
Renderer
Email Preview
Utilities
Next Steps
Now that you have Better Svelte Email installed, you’re ready to create your first email:Quickstart
Build your first email in under 5 minutes.
Components
Explore the complete component library.
Renderer API
Learn how to render emails to HTML.
Email Preview
Set up visual email previews in development.