Components

DefaultScrollAnchor

DefaultScrollAnchor adapts SwiftUI's defaultScrollAnchor modifier into an explicit wrapper.

Example

Requires React 18.2+ or 19 and shared styles. See setup.

Top

Loading preview…

Code
'use client';
import { Text } from '@swiftuijs/ui';
import { DefaultScrollAnchor } from '@swiftuijs/ui';
export default function Example() {
    return ((<DefaultScrollAnchor anchor="top">
      <Text>Start scrolled to the leading edge</Text>
    </DefaultScrollAnchor>));
}

Status: adapted

More examples

Variants

API reference

PropTypeRequiredDescription
anchor'top' | 'center' | 'bottom' | 'leading' | 'trailing'No—

Inherits additional props from IBaseComponent.