diff options
Diffstat (limited to 'examples/framework-svelte/README.md')
-rw-r--r-- | examples/framework-svelte/README.md | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/examples/framework-svelte/README.md b/examples/framework-svelte/README.md index 465863f72..deaf1da76 100644 --- a/examples/framework-svelte/README.md +++ b/examples/framework-svelte/README.md @@ -1,9 +1,38 @@ # Using Svelte with Astro -``` +This example showcases Astro's built-in support for [Svelte](https://svelte.dev/). + +## Installation + +### Automatic + +Bootstrap your Astro project with this template! + +```shell npm init astro -- --template framework-svelte ``` -This example showcases Astro's built-in support for [Svelte](https://svelte.dev/). +### Manual + +To use Svelte components in your Astro project: + +1. Install `@astrojs/renderer-svelte` + + ```shell + npm i @astrojs/renderer-svelte + ``` + +2. Add `"@astrojs/renderer-svelte"` to your `renderers` in `astro.config.mjs`. + + ```js + export default { + renderers: [ + "@astrojs/renderer-svelte", + // optionally, others... + ] + } + ``` + +## Usage -No configuration is needed to enable Svelte support—just start writing Svelte components in `src/components`. +Write your Svelte components as `.svelte` files in your project. |