React Native Lock Screen Smile Animation ๐๐
Wednesday, December 7, 2022
demos
mobile-input
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A lock screen component with PIN input and validation animations.
What's This About?
This component creates a secure PIN input interface similar to mobile device lock screens. It handles PIN validation with animated feedback, providing visual cues for correct and incorrect entries. The component includes event callbacks for various states including errors, clearing, and successful completion, making it suitable for authentication workflows.
Technical Implementation
The component uses:
PIN validation
Error handling
Input clearing
Completion events
Visual feedback
Usage
// Basic usage with callbacks
<LockScreen
correctPin="11111"
onError={(wrongPin) => {
console.log('Wrong PIN entered:', wrongPin);
}}
onClear={() => {
console.log('PIN cleared');
}}
onCompleted={() => {
console.log('Correct PIN entered');
}}
/>;
// Component props
type LockScreenProps = {
correctPin: string;
onError: (wrongPin: string) => void;
onClear: () => void;
onCompleted: () => void;
};
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Mobile Input
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback