# SvelteKit scroll animations

> Add scroll animations to SvelteKit: render Reveal and Cascade hidden in the server HTML, use attachments for client-only content, and keep csr turned on.

Use `@awesome-reveal/svelte` to add scroll animations to a SvelteKit app. [Install the package](/getting-started/#install-the-package), and import it in your components.

## Server rendering

`Reveal` and [`Cascade`](/guides/lists/) render the waiting element hidden in the server HTML. The package stylesheet hides it, so the content does not flash before the script runs. SvelteKit adds the stylesheet to the server HTML, in the development server and in the production build. You do not import it.

Hydration attaches the element to the viewport observer, with no hydration mismatch. With [`when={true}`](/guides/manual-control/), the server still renders the element hidden. The entrance plays after hydration.

```svelte
<script>
  import { Cascade, Reveal } from "@awesome-reveal/svelte";
</script>

<Reveal as="h1">Scroll animations in SvelteKit</Reveal>
<Cascade as="ul">
  <li>Fast</li>
  <li>Small</li>
  <li>Accessible</li>
</Cascade>
```

## Components and attachments

The `reveal` and `cascade` attachments do not run on the server. The server HTML shows the element. After hydration, the attachment hides the element until it reveals, so the content shows, then hides.

* For server-rendered content, use `Reveal` and `Cascade`.
* Use the attachments for content that only the browser renders. Examples are content that a user action adds, and a page with [`ssr = false`](https://svelte.dev/docs/kit/page-options#ssr).

## Keep client-side rendering on

Do not set [`csr = false`](https://svelte.dev/docs/kit/page-options#csr) on a page with a reveal. The page then loads no JavaScript, so no element reveals. The stylesheet hides each waiting element for 5 seconds, then shows it with no entrance. See [The 5 second hold](/concepts/server-rendering/#the-5-second-hold).
