Skip to content

Commit

Permalink
doc: Add about horizontal scroll to README (#6)
Browse files Browse the repository at this point in the history
* Support horizontal scroll

* Update src/index.tsx

* Add about direction to README.md

---------

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me@kentcdodds.com>
  • Loading branch information
3 people committed May 1, 2024
1 parent dbe1a7a commit 82dfef9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ And that's it! Now when the user navigates away from the page and then back to
it, the list will be scrolled to the position it was at when the user left the
page.

You can also specify horizontal scroll for elements like carousels:

```tsx
<ElementScrollRestoration elementQuery="#christmas-gifts" direction="horizontal" />
```
## Tips:

1. This requires an inline script, so you'll need to pass a `nonce` if you're
Expand Down

0 comments on commit 82dfef9

Please sign in to comment.