0425.12.mov
A cross-platform React Native component for intuitive 2D value selection, built with Expo and Reanimated.
- Smooth, spring-based animations
- Touch and drag gesture support
- Responsive grid system
- Cross-platform (iOS, Android, Web)
- Theme-aware styling
- Customizable grid size and colors
- Real-time value interpolation
-
Clone the repository:
git clone https://github.com/Solarin-Johnson/2d-selector-grid.git
-
Install dependencies:
npm install
-
Start the development server:
npx expo start
The SelectorGrid component can be used to create interactive 2D selection interfaces:
import SelectorGrid from '@/components/2dSelectorGrid';
function MyComponent() {
const gridRef = useRef<SelectorGridHandle>(null);
const cords = useSharedValue({ x: 0, y: 0 });
return (
<SelectorGrid
ref={gridRef}
color="white"
size={11}
initialX={3}
initialY={3}
flipX={true}
flipY={false}
cords={cords}
/>
);
}color: Grid dot color (default: "white")size: Grid size (must be odd number, default: 11)initialX/Y: Initial position (1-based)flipX/Y: Flip coordinates on respective axiscords: SharedValue for real-time coordinate tracking
- SelectorGrid: Main component for 2D value selection
- GridDots: Renders the interactive dot matrix
- SelectorPad: Example implementation with temperature/token controls
Built with:
-
Start the development server:
npx expo start
-
Choose your platform:
- Press
ifor iOS simulator - Press
afor Android emulator - Press
wfor web browser
- Press
MIT
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For support, join our Discord community or open an issue in the repository.