1. Config Options
  2. Drag Axis

By default, you can drag on both the horizontal and vertical axes. You can change this to just one axis using the dragAxis option.

Both (default)

createSwapy(container, {
  dragAxis: 'both'
})
A
B
C
D

Vertical

createSwapy(container, {
  dragAxis: 'y' // vertical
})
A
B
C
D

Horizontal

createSwapy(container, {
  dragAxis: 'x' // horizontal
})
A
B
C
D