Skip to content
Calm motion: animations on this site only fade, with no movement

SliderCaptcha ​

Slide the piece into the gap: a human check

A small puzzle before a form is sent: drag the handle until the loose piece fits the gap. It filters casual bots and mistakes, and it is nice to use on a phone. Enable your submit button with v-model:verified.

Basic
Slide the piece into the gap

Not security

Everything runs in the browser, so a script can skip it. Treat it as a speed bump: always check the real submission on the server (rate limits, a server-side challenge, or a service built for the job). The verify event gives you how long the solve took (ms) if you want to send that along as a weak signal.

Not accessible on its own

The puzzle needs sight. Keyboard users can solve it (← → move the piece, Shift for bigger steps, Enter to submit), but a screen-reader user cannot see the gap. Offer another way through (an email link, a text challenge) next to it.

  • A miss resets the slider and moves the gap, so there is nothing to learn from a failed try. tolerance is how close counts, as a fraction of the track (default 0.03).
  • Pass src for a picture to cut the piece from. Without it a checker pattern is drawn from the theme colors. The widget fills its container up to 360 px.
  • Once solved it stays locked until reset() (exposed) is called.

Usage ​

ts
import { BlessSliderCaptcha } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
srcstring—background picture; without it a checker pattern is drawn
tolerancenumber0.03how close counts, as a fraction of the track (0.03 = 3%)
labelstring"Slide the piece into the gap"
labelsPartial<{ verified: string; failed: string; }>—what is announced when the piece lands or misses
verifiedbooleanfalsetrue once solved; the widget then stays locked until `reset()`

Events

NamePayloadDescription
fail[]
update:verified[value: boolean]
verify[info: { ms: number; }]

Exposed

NameTypeDescription
reset() => void

Released under the MIT License. Character names and artwork belong to their owners.