Skip to main content

App UI

@ovok/native/ui provides optional React Native components for common health-app screens and interactions. Use them where they fit your product, then keep routing, active-patient context, authorization policy, persistence, and localization in the host app. The SDK components do not require you to adopt a particular navigation library or app architecture.

This guide covers the UI module and its integration boundaries. The reusable flows guide covers the higher-level pairing, manual-entry, and health access flows. For provider order and app initialization, see App shell and providers.

Import the feature you need​

Use the focused ui subpath for these optional components:

import {
BluetoothStateNotice,
EcgStripViewer,
MeasurementTrendChart,
} from "@ovok/native/ui";

Use the other public modules for their feature APIs:

NeedImport fromApp boundary
Shared SDK theme provider and theme tokens@ovok/nativeApp shell; see Theme
Bluetooth permissions, runtime, and device hooks@ovok/native/bt-managementBTProvider around Bluetooth routes
HealthKit and Health Connect authorization/import@ovok/native/data-syncPlatform authorization provider around the import route
Socket integration@ovok/native/socketApp-owned endpoint, authentication, and subscriptions
Reusable UI flows@ovok/native/uiComponent-specific providers and adapters

Install the peers required by the components you import. The installation guide lists peers and native configuration by feature.

Start with the app shell​

Place app-wide client and design-system providers in your root shell. The SDK's ThemeProvider loads the DM Sans font files and provides a generated React Native Paper theme. Add the optional bottom-sheet and keyboard providers only when the app uses components that need them. Follow App shell and providers for the provider tree and import aliases.

UI components call useOvokUi, which reads the current Paper theme and supplies fallback spacing and border-radius helpers. There is no separate OvokUiProvider. Use the SDK ThemeProvider or your own PaperProvider for app-wide Paper styling; component-level theme overrides and slots are for focused changes.

Choose a component by job​

The @ovok/native/ui reference catalogs every export and links to its props page.

ComponentUse it forIntegration boundary
BluetoothStateNoticeExplaining Bluetooth radio or permission state and offering recoveryPass the app's long-lived BleManager; it does not scan.
SupportedDevicesCatalogListShowing supported device metadata and manualsThe app handles the selected catalog entry; the component does not connect.
EcgStripViewerRendering already-decoded ECG samples as a paged waveformThe app owns sample decoding and interpretation.
MeasurementTrendChart and SparklinePlotting prepared numeric time-series valuesThe app supplies ordering, labels, units, and clinical context.
UrineTestResultPresenting an existing urine-analysis measurementSupply localized labels and the result; the component does not interpret it clinically.
BackgroundSyncSettingLetting a user toggle Bluetooth background scanningRender beneath BTProvider; keep app preference state synchronized with backgroundSync.enabled.

Pairing, manual entry, and the adapter-driven health access card are grouped under Reusable flows.

Other SDK UI surfaces​

The ui subpath is one component family in the SDK. The other app-facing component families have their own references:

SurfaceReference
Theme provider, colors, spacing, and theme hookTheme
Sign-in, registration, profile, password, and session UIAuth components
Bluetooth provider, hooks, and device-management UIBluetooth management and device catalog
Health authorization and import componentsData sync
SDK UI widgets in the ui subpathApp UI components

Adapt theme and primitives​

All UI components accept the shared OvokUiProps where applicable:

<BluetoothStateNotice
bleManager={bleManager}
theme={{ colors: { primary: "#1457A6" } }}
slots={{ Text: AppText, Button: AppButton }}
onOpenSettings={() => navigation.navigate("BluetoothSettings")}
/>

OvokThemeOverride merges shallowly at the top level and one level deep for colors and fonts. spacing and borderRadius are functions used by the UI, so provide functions for those values when overriding them. The slots object replaces individual React Native Paper primitives: Button, Card, Text, Switch, TextInput, and ActivityIndicator. UrineTestResult also supports an UrineAnalyteRow slot. Replacement components should accept the corresponding Paper props and preserve accessibility behavior.

Use ThemeProvider or PaperProvider when typography or colors should be consistent throughout the app. A component-level fonts override is not a replacement for configuring Paper typography. The SDK loads DM Sans assets through ThemeProvider, but does not automatically select them for Paper text variants.

Keep decisions with the app​

The UI module is presentation and integration glue. The app owns:

  • navigation after a successful action;
  • the active patient and account;
  • permission rationale, consent, and product policy;
  • saving manual entries and uploading measurements;
  • HealthKit or Health Connect record mappings and import services;
  • translations, analytics, and app-specific error handling.

Mount providers only around routes that need their side effects. PairingFlow needs an active BTProvider; actual HealthKit and Health Connect imports use DataSync, while HealthImportCard needs an app-owned adapter and only presents its status and request interaction.