Slide to unlock

Drag the handle to the end, or use the arrow keys, and the action fires; let go early and it springs back.

Unlocked 0 times

Features

  • Drag the handle to the end to fire; let go early and it springs back.
  • The handle is a slider for assistive tech: arrow keys move it, End unlocks.
  • The label sheens across the track and fades as you slide.

Use it for

  • A playful confirm.
  • Going home from a 404.

On this site

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react lucide-react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

API

PropTypeWhat it does
labelstringThe text and the handle's name.
onUnlock() => voidFires at the end.

Accessibility

Source

The code is in src/kit/slide-to-unlock.tsx in runets, MIT licensed.