packages/lynx-ui-scroll-view/SKILL.md
# lynx-ui-scroll-view SKILL `ScrollView` is a general-purpose scroll container used to display content that exceeds the viewport in either vertical or horizontal direction. For massive datasets, prefer `List` or `FeedList` to ensure performance. ## 1. Core Capabilities - **Vertical and Horizontal Scrolling**: Supports vertical (`scrollOrientation = 'vertical'`) and horizontal (`scrollOrientation = 'horizontal'`) scrolling. - **BounceableOptions**: Supports edge rubber-band and bounce effects,
npx skillsauth add lynx-family/lynx-ui packages/lynx-ui-scroll-viewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ScrollView is a general-purpose scroll container used to display content that exceeds the viewport in either vertical or horizontal direction. For massive datasets, prefer List or FeedList to ensure performance.
scrollOrientation = 'vertical') and horizontal (scrollOrientation = 'horizontal') scrolling.enableBounces: enable/disable edge bouncesingleSidedBounce: select bounce side ('upper' | 'lower' | 'both')alwaysBouncing: allow bouncing even when content does not exceed the viewportstartBounceTriggerDistance / endBounceTriggerDistance: threshold distance to trigger onScrollToBouncesonScrollToBounces(info): callback when reaching upper/lower edge (info.direction is 'upper' | 'lower')enableBounceEventInFling: trigger bounce events during inertial flingvalidAnimationVersion: compatibility switch to use setTimeout instead of requestAnimationFrame on lower Lynx versionsimport { ScrollView } from '@lynx-js/lynx-ui'
function BasicScrollView() {
return (
<ScrollView
scrollOrientation='vertical'
style={{ height: '300px', width: '100%' }}
>
<view style={{ height: '800px', background: 'lightgray' }}>
<text>Very long content...</text>
</view>
</ScrollView>
)
}
When you need flex layout, add a wrapper as the first child of ScrollView, and apply flex styles on that wrapper:
Also make sure the direct child of ScrollView is larger than the ScrollView viewport on the scrolling axis. Otherwise, the content does not overflow and the ScrollView will not scroll.
import { ScrollView } from '@lynx-js/lynx-ui'
function FlexWrapperExample() {
return (
<ScrollView scrollOrientation='vertical' style={{ height: '240px' }}>
{/* 第一层:wrapper view(设置 flex) */}
<view style={{ display: 'flex', flexDirection: 'row', gap: '8px' }}>
<view
className='card'
style={{ width: '100px', height: '100px', background: 'skyblue' }}
/>
<view
className='card'
style={{ width: '100px', height: '100px', background: 'salmon' }}
/>
<view
className='card'
style={{ width: '100px', height: '100px', background: 'khaki' }}
/>
</view>
</ScrollView>
)
}
Scenario Description + Scroll Configuration (direction, events) + Content and Style
Example Prompt:
ScrollView with a height of 400px. The content within it has a total height of 1000px."ScrollView that triggers a ‘load more’ function when scrolled to the bottom, using onScrollToLower."ScrollView and a ‘Back to Top’ button. When the button is clicked, smoothly scroll back to the top."import { ScrollView } from '@lynx-js/lynx-ui'
function VerticalScrollView() {
return (
<ScrollView scrollY={true} style={{ height: '200px' }}>
<view style={{ height: '500px' }}>
{/* ... Long content ... */}
</view>
</ScrollView>
)
}
Example Path: apps/examples/src/ScrollView/Basic/index.tsx
import { ScrollView } from '@lynx-js/lynx-ui'
function HorizontalScrollView() {
return (
<ScrollView scrollOrientation='horizontal' style={{ width: '100%' }}>
<view style={{ flexDirection: 'row' }}>
{[...Array(10)].map((_, i) => <view key={i} className='card' />)}
</view>
</ScrollView>
)
}
Example Path: apps/examples/src/ScrollView/Basic/index.tsx
import { ScrollView } from '@lynx-js/lynx-ui'
function LoadMoreScrollView() {
const loadMore = () => {
console.log('Reached the bottom, loading more data...')
}
return (
<ScrollView
scrollY={true}
style={{ height: '300px' }}
onScrollToLower={loadMore}
lower-threshold='50'
>
{/* ... list content ... */}
</ScrollView>
)
}
Example Path: apps/examples/src/ScrollView/Event/index.tsx
Q: Why can't my ScrollView scroll?
A: ScrollView needs a determined boundary. Set a fixed size (e.g., height: '300px') or place it in a flex container and use flex: 1. Also ensure the direct child of ScrollView is larger than the viewport on the scrolling axis. For example, a vertical ScrollView with height: '300px' needs a direct child taller than 300px; otherwise it will not scroll.
Q: ScrollView inside Popup causes drag conflicts?
A: Pass the main-thread:gesture object provided by Popup to ScrollView's main-thread:gesture for proper gesture arbitration.
Q: Long lists stutter with ScrollView + .map()?
A: Use List or FeedList for large datasets; they provide virtualization and view reuse. ScrollView suits limited content scenarios.
**Q: How to implement “Back to Top”?
A: Maintain a scroll position state and programmatically set scroll-top (or use native APIs) on interaction.
Q: How to use flex layout inside ScrollView?
A: The first-level direct child of ScrollView is constrained to display: linear. If you need flex, add a wrapper view as the first child and apply all flex-related styles to that wrapper.
ScrollView is a container component. Its direct child elements are the scrollable content. There are no named child components.
development
# lynx-ui-sortable SKILL `Sortable` is a headless drag-to-reorder list primitive for ReactLynx. It performs reordering on the main thread for smooth, gesture-driven animations and exposes a composable `SortableRoot` / `SortableItem` / `SortableItemArea` API. For massive datasets, prefer `List` or `FeedList`; `Sortable` targets small to medium reorder-able lists. ## 1. Core Capabilities - **Headless Composition**: Three building blocks — `SortableRoot`, `SortableItem`, and (optional) `Sortable
development
# lynx-ui-sheet SKILL ## What It Is `lynx-ui-sheet` is a headless Sheet primitive for ReactLynx. It supports bottom-sheet semantics and side-drawer semantics through the same composition model, state model, drag handling, backdrop, and snap-point APIs. Use it when a UI needs a dismissible panel that slides from an edge of the viewport and may be controlled by refs, external state, snap points, or drag gestures. ## Building Blocks - **`SheetRoot`**: Owns visibility state, side, snap points,
development
# Lynx UI Popover SKILL `lynx-ui-popover` is a headless primitive for building accessible, positioned floating elements. It handles the complex logic of positioning, stacking context, and enter/exit animations via `usePresence`. ## 1. Core Capabilities - **Headless & Composable**: Provides raw functional components (`Root`, `Trigger`, `Positioner`, `Content`) that you compose to build custom UIs. - **Auto Positioning**: The `PopoverPositioner` automatically calculates coordinates to anchor th
development
# lynx-ui-dialog SKILL `Dialog` is a dialog component, used to display important information or require user interaction, interrupting the current workflow. `lynx-ui-dialog` is a composite component built on `primitives`, offering high flexibility and customizability. ## 1. Core Capabilities - **Composite Component Structure**: Composed of `DialogRoot`, `DialogView`, `DialogBackdrop`, `DialogContent`, `DialogTrigger`, and `DialogClose`, allowing for free assembly of the dialog's structure. -