Components
ScrollTarget
ScrollTarget marks a stable scroll destination that can be resolved by ScrollViewReader.
Example
Requires React 18.2+ or 19 and shared styles. See setup.
Default
Loading preview…
Code
'use client';
import { Card } from '@swiftuijs/ui';
import { ScrollTarget } from '@swiftuijs/ui';
export default function Example() {
return (<ScrollTarget scrollId="chapter-2">{(<Card>
<div style={{ padding: '16px' }}>Scroll target content</div>
</Card>)}</ScrollTarget>);
}Status: adapted
API reference
| Prop | Type | Required | Description |
|---|---|---|---|
scrollId | string | Yes | — |
Inherits additional props from IBaseComponent.