Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: explain how to make scrolling to an anchor smooth #815

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions solara/server/assets/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
html {
/* override vuetify's css reset ress.css */
overflow-y: auto;
scroll-behavior: smooth;
}

.jupyter-widgets code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ The `solara.Link` component also supports linking to HTML elements identified by
solara.v.Btn(attributes={"id": "my-id"}, ...)
```

You can then link to a particular element by appending `#` followed by its id to your link, i.e. `solara.Link(route_or_path="/page#my-id")`.
You can then link to a particular element by appending `#` followed by its id to your link, i.e. `solara.Link(route_or_path="/page#my-id")`. If you want the page to smoothly scroll to the linked element, you should give an element that contains it (for instance the `html`-element) the following CSS rule:

```css
html {
scroll-behaviour: smooth;
}
```

## Fully manual routing

Expand Down
Loading