Duration Slider with React Native Skia ๐
Tuesday, September 10, 2024
Try the live demo
Scan to try on your device
Need the app?
demos
duration-slider
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A circular slider component for selecting duration values. Uses Skia for rendering and custom font integration.
What's This About?
This component creates a circular slider that:
Shows duration values from 1 to 12
Updates value through rotation
Uses custom SF Pro Rounded font
Adapts to screen width
Technical Implementation
The component uses:
Skia for rendering
Custom font loading
Responsive sizing
Value range management
Rotation gesture handling
Usage
type CircularSliderProps = {
minVal: number;
maxVal: number;
width: number;
height: number;
font: SkFont;
onValueChange: (value: number) => void;
};
// Basic usage
const font = useFont(sfProRoundedBold, 100);
{
font && (
<CircularSlider
minVal={1}
maxVal={12}
width={300}
height={300}
font={font}
onValueChange={(value) => {
console.log('Selected duration:', value);
}}
/>
);
}
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Duration Slider
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback