GuidesComponentsTile

Tile.Status

Device connection status indicator with colored text and localized messages

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Device connection status indicator that displays the current state of a Bluetooth measurement device with color-coded text and localized status messages.

Quick Example

import { DeviceStatus, Tile } from "@ovok/native";
import React from "react";

const StatusExample = () => {
  return (
    <Tile>
      <Tile.Status status={DeviceStatus.CONNECTED} testID="device-status" />
    </Tile>
  );
};

export default StatusExample;

Props

Every prop, with its type and description, is listed in the @ovok/native/tile API reference.

Device Status Types

The component supports these device status values:

DeviceStatus.CONNECTED

  • Color: Green (700 shade)
  • Meaning: Device is connected and ready for measurement
  • Translation Key: tile.status.connected

DeviceStatus.DISCONNECTED

  • Color: Red (700 shade)
  • Meaning: Device is not connected or out of range
  • Translation Key: tile.status.disconnected

DeviceStatus.MEASURING

  • Color: Blue (700 shade)
  • Meaning: Device is actively taking a measurement
  • Translation Key: tile.status.measuring

DeviceStatus.LOW_BATTERY

  • Color: Orange (700 shade)
  • Meaning: Device battery is low and needs charging
  • Translation Key: tile.status.low_battery

Component Behavior

The Status component:

  1. Color Mapping: Automatically maps device status to appropriate theme colors
  2. Text Display: Shows localized status text based on the status value
  3. Typography: Uses small, consistent text styling (12px, regular weight)
  4. Color Memoization: Optimizes color calculations for performance

Localization

Translation keys supplied by the app

The component uses these translation keys:

{
  "tile": {
    "status": {
      "connected": "Connected",
      "disconnected": "Disconnected",
      "measuring": "Measuring...",
      "low_battery": "Low Battery"
    }
  }
}
  • tile.status.connected - Device is connected and ready
  • tile.status.disconnected - Device is not connected
  • tile.status.measuring - Device is actively measuring
  • tile.status.low_battery - Device battery is low

The SDK requests these keys through the app's react-i18next resources; it does not ship the English strings shown above. If a key is missing, the raw key may be rendered.

Styling

Theme Colors Used

  • theme.colors.green[700] - Connected status
  • theme.colors.red[700] - Disconnected status
  • theme.colors.blue[700] - Measuring status
  • theme.colors.orange[700] - Low battery status

Color Accessibility

The component uses semantic colors that provide clear meaning:

  • Green: Positive state (connected/ready)
  • Red: Error state (disconnected/unavailable)
  • Blue: Active state (measuring/in progress)
  • Orange: Warning state (low battery/attention needed)

The 700 shades are defaults, not a contrast guarantee. Check the actual palette against the app's background in every supported theme.

Last updated on

On this page