A primitive component for building advanced scrolling experiences. It provides extra features compared to normal scroll containers, as well as performance optimizations when used inside or around a Sheet component.
We recommend using the Scroll component for all scrolling across your app.
import { Scroll } from "@silk-hq/sheet";
export default () => (
<Scroll.Root>
<Scroll.View>
<Scroll.Content>
...
</Scroll.Content>
</Scroll.View>
<Scroll.Trigger />
</Scroll.Root>
);
<Scroll.Root>
Presence | Required |
---|---|
Composition | Contain all other Scroll sub-components |
Underlying element | <div> |
Description
The Root sub-component wraps all other Scroll sub-components of the same Scroll instance, as it contains logic shared among all.
Presence | Optional |
---|---|
Type | `boolean |
Default | undefined |
Description
Defines whether the sub-component underlying element is the default one or the one passed as child of the sub-component.
Values description