KQ-508 · VOTE/PAIR

Vote Pair

Up and down vote buttons with the tally rolling between them. The chosen thumb pops from 0.78 on recoil and holds an 8° tilt toward its own direction on snap, while the tally rolls in the direction it moved and travels further when a side switch swings it by two. Both halves are toggle buttons carrying aria-pressed, so Enter or Space on the side already chosen withdraws the vote.

KQ-508 · VOTE/PAIR
Fernworks · two answers
Score41
ReevePin the runner to the release tag. The drift you are seeing comes from the floating one.
Score12
OkonjoCache the lockfile hash rather than the lockfile — invalidation gets much cheaper.

Reeve 41Okonjo 12

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/vote-pair

Props

value / defaultValue
1 | 0 | -1
default 0
Controlled or initial vote: up, none, or down.
score
number
default
The tally before the reader's own vote is added; the control shows score + value.
onVote
(value: 1 | 0 | -1) => void
default
Fires on every change, including the withdrawal back to 0.
size
"sm" | "md"
default "md"
Control size; both halves and the tally share one height.
subject
string
default "answer"
Names what is being voted on inside each button's accessible label.