Skip to main content
⚙️

Device

System
View Docs

Get 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

PropertyTypeDescription
infoDeviceInfo | nullDevice info (model, platform, OS version, etc.)
batteryBatteryInfo | nullBattery info (level, isCharging)
languageLanguageInfo | nullLanguage/locale information
deviceIdstring | nullUnique device identifier
isLoadingbooleanWhether an operation is in progress
errorError | nullCurrent 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

Related Features