slide to unlock
Installation
Section titled “Installation”pnpm dlx shadcn@latest add pxl-ui/registry/slide-to-unlock
Install the following dependencies:
pnpm add motion
Copy and paste the following code into your project.
Update the import paths to match your project setup.
import { SlideToUnlock, SlideToUnlockHandle, SlideToUnlockText, SlideToUnlockTrack,} from "@/components/ui/pxl/slide-to-unlock"<SlideToUnlock> <SlideToUnlockTrack> <SlideToUnlockText> slide to unlock </SlideToUnlockText> <SlideToUnlockHandle /> </SlideToUnlockTrack></SlideToUnlock>Composition
Section titled “Composition”Use the following composition to build a SlideToUnlock
SlideToUnlock└── SlideToUnlockTrack ├── SlideToUnlockText └── SlideToUnlockHandleAPI reference
Section titled “API reference”SlideToUnlock
Section titled “SlideToUnlock”| Prop | Type | Default | Description |
|---|---|---|---|
handleWidth |
number |
- | Width of the drag handle in pixels. |
onUnlock |
(() => void) | undefined |
- | Called when the handle is dragged fully to the end. |
SlideToUnlockText
Section titled “SlideToUnlockText”| Prop | Type | Default | Description |
|---|---|---|---|
children |
React.JSX.Element | ((props: { isDragging: boolean; }) => React.JSX.Element) | string |
- | Accepts a render function as children to react to the dragging state. |