⚙️
View DocsDevice
SystemGet device information, battery status, and language
infobatteryplatformmodellanguage
Demo
Platform Detection
📱
Native
No
🌐
Web
Yes
🍎
iOS
No
🤖
Android
No
Device Information
Loading device information...
Battery Status
Loading battery status...
Language
Loading...
Device ID
Loading...
Note: Device information varies by platform. On web browsers, some fields like manufacturer or device name may not be available. The Device ID is a unique identifier that persists across app reinstalls on native platforms.
Usage
import { useDevice } from '@classic-homes/native/svelte';
// or for React:
import { useDevice } from '@classic-homes/native/react';API Reference
| Property | Type | Description |
|---|---|---|
| info | DeviceInfo | null | Device info (model, platform, OS version, etc.) |
| battery | BatteryInfo | null | Battery info (level, isCharging) |
| language | LanguageInfo | null | Language/locale information |
| deviceId | string | null | Unique device identifier |
| isLoading | boolean | Whether an operation is in progress |
| error | Error | null | Current error if any |
| getInfo | () => Promise<DeviceInfo> | Fetch device information |
| getBatteryInfo | () => Promise<BatteryInfo> | Fetch battery status |
| getLanguageCode | () => Promise<LanguageInfo> | Fetch language/locale |
| getId | () => Promise<string> | Get unique device ID |