Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

view-pager

БесплатноЗапускает вложенные скриптыНе проверен

Build data-driven, horizontally swipeable page navigation with stable page identity, generated native page containers, optional exposure-based lazy rendering…

lynx-familyот 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

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

CHANGELOG.mdLICENSEREADME.mdREADME_zh.mddocs/APIReference.mdxdocs/README.mdxdocs/README.zh.mdxpackage.jsonrslib.config.tssrc/index.tsxsrc/types/index.docs.tssrc/types/index.tssrc/utils.tstsconfig.docs.jsontsconfig.jsonvitest.config.ts

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить view-pager с