Navigation
Horizontal pager
snap pager + dots
function HorizontalPagerDemo() { return ( <View className="-mx-5 self-stretch"> <HorizontalPager itemWidth={280} showDots={false}> {['Getting started', 'Tips and tricks', 'What is new'].map((t, i) => ( <View key={t} className="bg-card border-border h-36 justify-end rounded-xl border p-4"> <Text className="text-muted-foreground text-xs">Card {i + 1}</Text> <Text className="text-lg font-semibold">{t}</Text> </View> ))} </HorizontalPager> </View> );}Usage
Peeking cards: itemWidth smaller than the screen shows the next card. Dots included.
API
<HorizontalPager itemWidth gap? showDots? onIndexChange?>{cards}</HorizontalPager>Get it
Already in every copy of the native kit:
import { HorizontalPager } from '@/components/kit/horizontal-pager';Details
- Exports
HorizontalPager- Installs with
- @halftone-native/pager-dots
- Also searched as
- carousel, swipe, slides, banner
- Registry JSON
- /r/native/horizontal-pager.json
<HorizontalPager className="w-80 max-w-full" aria-label="What’s new"> {SLIDES.map((s) => ( <div key={s.seed} className="bg-card flex flex-col gap-3 rounded-xl border p-3"> <Placeholder seed={s.seed} ratio={2} /> <div className="px-1 pb-1"> <p className="font-semibold">{s.title}</p> <p className="text-muted-foreground text-sm">{s.body}</p> </div> </div> ))}</HorizontalPager>Usage
Peeking cards: an itemWidth under 100% shows the next card. Dots included.
API
<HorizontalPager itemWidth? gap? showDots? onIndexChange?>{cards}</HorizontalPager>Get it
Already in every copy of the web kit:
import { HorizontalPager } from '@/components/kit/horizontal-pager';Details
- Exports
HorizontalPager- Packages
- cn@^0.5.2
- Installs with
- @halftone-web/pager-dots
- Also searched as
- carousel, swipe, slides, banner
- Registry JSON
- /r/web/horizontal-pager.json
Agents: the whole registry is at /llms.txt.