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

PropTypeRequiredDescription
scrollIdstringYes—

Inherits additional props from IBaseComponent.