Sign in to Reactiive

Use your Google or Apple account.
Signing in subscribes you to the newsletter: new content and the occasional promotion. Unsubscribe at any time.
Skip to content

Duration Slider with React Native Skia ๐Ÿ•’

Tuesday, September 10, 2024
enzomanuelmangano
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