view-pager
БесплатноЗапускает вложенные скриптыНе проверенBuild data-driven, horizontally swipeable page navigation with stable page identity, generated native page containers, optional exposure-based lazy rendering…
от lynx-family★ 122 звезды на GitHubОб этом скилле
lynx-ui-view-pager
Use ViewPager when a collection of data should render as horizontally swipeable pages. The component generates the required direct native viewpager-item children.
import { useRef } from '@lynx-js/react'
import { ViewPager } from '@lynx-js/lynx-ui'
import type { ViewPagerRef } from '@lynx-js/lynx-ui'
const pages = [
{ id: 'first', title: 'First page' },
{ id: 'second', title: 'Second page' },
]
export function Pages() {
const pager = useRef<ViewPagerRef>(null)
return (
<ViewPager
ref={pager}
data={pages}
getItemKey={page => page.id}
itemStyle={{ width: '100%', height: '100%' }}
style={{ height: '400px' }}
>
{page => <text>{page.title}</text>}
</ViewPager>
)
}
getItemKey defaults to the item index. Provide stable, unique values when pages can be inserted, removed, or reordered so page state remains attached to the correct data item. Use itemClassName and itemStyle to style every generated native item. Use getItemProps for per-item native class names, styles, accessibility attributes, and other native properties. Per-item styles override shared item styles; ViewPager manages item keys, refs, and children.
initialSelectIndex applies only at mount. Navigate later with ref.current?.scrollToPage(index, smooth). onPageChange, onPageWillChange, and onOffsetChange receive native events; read payload fields such as the selected index from event.detail.
Use main-thread:onPageChange, main-thread:onPageWillChange, or main-thread:onOffsetChange with a 'main thread' function when the handler must run on the main thread. These props receive the same event shapes as their regular-thread counterparts.
Pages render eagerly unless lazyOptions.enableLazy is true. Lazy mode renders the initial page immediately and uses Lynx exposure placeholders for the rest. Give each pager a page-unique scene; use exposureLeft and exposureRight to control how early neighboring pages render. Once rendered, a page stays mounted while its keyed data item remains.
The page renderer receives only (item, index), not selection state. Keep selection-dependent UI outside page content or update it explicitly from onPageChange; native swipes do not otherwise require React to rerender the pager's page content.
Установить view-pager в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл view-pager?
Build data-driven, horizontally swipeable page navigation with stable page identity, generated native page containers, optional exposure-based lazy rendering, and imperative navigation.
Как установить скилл view-pager?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл view-pager запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic