EdgeScrubber
A pill on the right edge you drag up and down to pick a value (months by default). It grows while held, the edge swells into a bump, and it snaps with a haptic tick.
Preview
Installation
npx @codewithrabby/ui@latest add edge-scrubberUsage
import { EdgeScrubber } from "@/components/uir/edge-scrubber";
<View style={{ flex: 1 }}>
<EdgeScrubber
inset={{ top: insets.top + 60, bottom: insets.bottom + 80 }}
onChange={(index, month) => setMonth(month)}
/>
</View>
// any list works
<EdgeScrubber items={["A", "B", "C", "D"]} />Props
| Prop | Type | Default |
|---|---|---|
itemsValues to scrub through, top to bottom. | string[] | MONTHS |
initialIndexValue the pill starts on. | number | 0 |
onChangeCalled when the snapped value changes. | (index, item) => void | — |
insetSpace kept free above and below the track. | { top?, bottom? } | { 40, 40 } |
colorPill and bump colour. | string | "#000" |
textColorText colour in the pill. | string | "#fff" |
pillWidthPill width. | number | 54 |
activeScaleHow much the pill grows while held. | number | 1.45 |
bumpDepthHow far the bump swells in from the edge. | number | 16 |
hapticsHaptic tick on every step. | boolean | true |