01
02
03
04
05
06
Drag it, throw it, or use the arrows
A rail you can drag, throw or step through. It always lands on a card, and the end of a drag never counts as a click.
Drag it, throw it, or use the arrows
import { useDragRail } from '@wdzyi/ui';
const { rail, ends, step } = useDragRail();
<div {...rail} className='rail'>
{cards}
</div>
<button disabled={ends.end} onClick={() => step(1)}>Next</button>Part of @wdzyi/ui. See setup to install it, or copy the code above.