# Svelte Scroll Spy


## Setup

```svelte
<script lang="ts">
  import { ScrollSpy } from  'flowbite-svelte';
</script>
```

## Usage Examples

See [examples](/docs-examples/extend/scroll-spy) and [code](https://github.com/themesberg/flowbite-svelte/tree/main/src/routes/docs-examples/extend/scroll-spy).


## Component data

### ScrollSpy

#### Types

[ScrollSpyProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2328)

#### Props

- items
- position: "top"
- offset: 0
- sticky: true
- activeClass: ""
- inactiveClass: ""
- class: className: ""
- smoothScroll: true
- scrollContainer
- onActiveChange
- onNavigate
- classes


## See also


