Skip to content

RiffleEventMap

Defined in: types.ts:260

Every event Riffle.on can subscribe to, keyed by name, with each key’s payload type.

riffle.on('change', (event) => console.log(event.index))

change: object

Defined in: types.ts:262

The active card changed, whether from a drag, a button, or goTo().

direction: -1 | 1

index: number

previousIndex: number


drag: object

Defined in: types.ts:270

Fires once per pointer move, which browsers coalesce to frame cadence. Do not retain the payload: it is reused between calls. Do not allocate in this handler.

offset: number

progress: number


dragend: object

Defined in: types.ts:272

A drag gesture ended, committed or not.

committed: boolean

direction: -1 | 0 | 1


dragstart: object

Defined in: types.ts:264

A drag gesture started.

index: number

pointerType: "mouse" | "touch" | "pen"


settle: object

Defined in: types.ts:274

The spring reached its target and the stack is at rest.

index: number