@kryndal/react-native-device-kit
v1.0.0
Published
Comprehensive React Native device toolkit — camera, gallery, clipboard, haptics, biometrics, screen brightness, sharing, device info. Zero native setup, pure hooks.
Downloads
14
Maintainers
Readme
react-native-device-kit
Comprehensive React Native device toolkit — 7 hooks for camera, clipboard, haptics, biometrics, screen, sharing, and device info. Zero native setup.
npm install react-native-device-kitModules
📸 useMedia() — Camera & Gallery
import { useMedia } from 'react-native-device-kit';
const { launchCamera, launchGallery, loading } = useMedia();
const photo = await launchCamera({ quality: 0.8 });
const images = await launchGallery({ allowMultiple: true });Optional: npm install react-native-image-picker
📋 useClipboard() — Copy & Paste
import { useClipboard } from 'react-native-device-kit';
const { copy, paste, lastCopied } = useClipboard();
copy('Hello World!');
const text = await paste();📳 useHaptics() — Haptic Feedback
import { useHaptics } from 'react-native-device-kit';
const { trigger, vibrate } = useHaptics();
trigger('success'); // light | medium | heavy | selection | success | warning | error
vibrate(200); // msOptional: npm install react-native-haptic-feedback (for rich iOS haptics)
💡 useScreen() — Brightness & Keep-Awake
import { useScreen } from 'react-native-device-kit';
const { brightness, setBrightness, keepAwake } = useScreen();
setBrightness(0.8);
keepAwake(true);📤 useShare() — Native Share Dialog
import { useShare } from 'react-native-device-kit';
const { share } = useShare();
await share({ message: 'Check this out!', url: 'https://...' });🔐 useBiometrics() — Face ID / Fingerprint
import { useBiometrics } from 'react-native-device-kit';
const { authenticate, isAvailable } = useBiometrics();
const ok = await authenticate('Unlock to continue');Optional: npm install react-native-biometrics
📏 useDeviceInfo() — Device Info & Sizing
import { useDeviceInfo } from 'react-native-device-kit';
const { platform, isTablet, scale } = useDeviceInfo();
const fontSize = scale(16); // responsive font sizeAPI Reference
| Hook | Returns | Optional Dep |
|------|---------|-------------|
| useMedia() | { launchCamera, launchGallery, loading } | react-native-image-picker |
| useClipboard() | { copy, paste, lastCopied } | none |
| useHaptics() | { trigger, vibrate } | react-native-haptic-feedback |
| useScreen() | { brightness, setBrightness, keepAwake } | none |
| useShare() | { share, loading } | none |
| useBiometrics() | { authenticate, isAvailable, getType } | react-native-biometrics |
| useDeviceInfo() | { platform, isTablet, scale, ... } | none |
Features
- ✅ Zero native setup — pure JS hooks, no linking
- ✅ TypeScript-first — full type coverage
- ✅ Optional deps — only install what you need
- ✅ Graceful fallbacks — works on web, unsupported platforms
- ✅ < 5KB gzipped
License
MIT © Muhammad Suleman
