@ovok/native/ui

Ready-made measurement and device flows: pairing, manual entry, charts, calendars and ECG strips.

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

Ready-made measurement and device flows: pairing, manual entry, charts, calendars and ECG strips.

Import from @ovok/native/ui.

Components

Calendar

const Calendar: MemoExoticComponent<(__namedParameters) => Element>;

Month calendar with selectable, markable days.


MeasurementTrendChart

const MeasurementTrendChart: MemoExoticComponent<(__namedParameters) => Element>;

Line chart of measurement readings with optional normal range and threshold lines.


Sparkline

const Sparkline: MemoExoticComponent<(props) => Element>;

Compact MeasurementTrendChart with small default dimensions.


BackgroundSyncSetting()

function BackgroundSyncSetting(__namedParameters): Element;

Card with a switch to enable background Bluetooth sync and its current status.

Parameters

ParameterType
__namedParametersBackgroundSyncSettingProps

Returns

Element


BluetoothStateNotice()

function BluetoothStateNotice(__namedParameters): Element | null;

Card that explains why Bluetooth is unavailable and offers the fixing action; renders nothing when Bluetooth is on.

Parameters

ParameterType
__namedParametersBluetoothStateNoticeProps

Returns

Element | null


EcgStripViewer()

function EcgStripViewer(__namedParameters): Element;

Paged ECG strip on a millimetre grid.

Parameters

ParameterType
__namedParametersEcgStripViewerProps

Returns

Element


FlowFrame()

function FlowFrame(__namedParameters): Element;

Layout primitive for host-owned, multi-step flows. It does not navigate or save data.

Parameters

ParameterType
__namedParametersFlowFrameProps

Returns

Element


HealthImportCard()

function HealthImportCard<TType>(__namedParameters): Element;

Card with a switch to enable health data import and the access status per type.

Type Parameters

Type Parameter
TType extends string

Parameters

ParameterType
__namedParametersHealthImportCardProps<TType>

Returns

Element


ManualEntryForm()

function ManualEntryForm(__namedParameters): Element;

Form to enter and save a measurement manually, validated against the field ranges.

Parameters

ParameterType
__namedParametersManualEntryFormProps

Returns

Element


NearbyDevicePrompt()

function NearbyDevicePrompt(__namedParameters): Element;

Modal that asks whether a nearby device is the user's and pairs it on acceptance.

Parameters

ParameterType
__namedParametersNearbyDevicePromptProps

Returns

Element


PairingFlow()

function PairingFlow(__namedParameters): Element;

Lists nearby Bluetooth devices and pairs the one the user selects.

Parameters

ParameterType
__namedParametersPairingFlowProps

Returns

Element


PeriodCalendar()

function PeriodCalendar(__namedParameters): Element;

Calendar that highlights date ranges, such as menstrual periods.

Parameters

ParameterType
__namedParametersPeriodCalendarProps

Returns

Element


PrerequisiteGate()

function PrerequisiteGate<T>(__namedParameters): Element;

Loads host-defined, account-scoped prerequisites before rendering children. This is a UI gate only; backend authorization remains authoritative.

Type Parameters

Type Parameter
T

Parameters

ParameterType
__namedParametersPrerequisiteGateProps<T>

Returns

Element


SupportedDevicesCatalogList()

function SupportedDevicesCatalogList(__namedParameters): Element;

Scrollable catalog of supported devices with photo, measurements and manual link.

Parameters

ParameterType
__namedParametersSupportedDevicesCatalogListProps

Returns

Element


UrineTestResult()

function UrineTestResult(__namedParameters): Element;

Lists the analytes of a urine test with their values and usual ranges.

Parameters

ParameterType
__namedParametersUrineTestResultProps

Returns

Element

Hooks

useOvokUi()

function useOvokUi(__namedParameters?): object;

Resolves the theme and UI slots from the Paper theme, overrides and slot replacements.

Parameters

ParameterType
__namedParameters?OvokUiProps

Returns

NameTypeDescription
slotsResolvedOvokUiSlotsUI primitives with the react-native-paper defaults filled in.
themeOvokThemeActive theme with the override merged in.

Functions

mergeOvokTheme()

function mergeOvokTheme(base, override?): OvokTheme;

Merges a theme override over a base theme, including colors and fonts.

Parameters

ParameterType
baseOvokTheme
override?OvokThemeOverride

Returns

OvokTheme

Interfaces

BackgroundSyncSettingProps

Props of BackgroundSyncSetting.

Extends

Properties

PropertyTypeDescriptionInherited from
canEnable?() => Promise<boolean>Checked before turning sync on; resolve false to mark it restricted.UseBackgroundSyncOptions.canEnable
description?ReactNodeText under the heading; defaults to a platform-specific description.-
enabled?booleanInitial state; defaults to off.UseBackgroundSyncOptions.enabled
onEnabledChange?(enabled) => void | Promise<void>Called before the new state is applied, for example to persist it.UseBackgroundSyncOptions.onEnabledChange
reasonLabels?Partial<Record<string, string>>Overrides the reason texts.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
statusLabels?Partial<Record<"blocked" | "on" | "off" | "restricted", string>>Overrides the status texts.-
testID?stringTest identifier of the card.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
title?stringCard heading.-

BluetoothStateNoticeCopy

Texts shown for one Bluetooth state.

Properties

PropertyTypeDescription
action?stringLabel of the action button.
body?stringExplanatory text.
heading?stringHeading text.

BluetoothStateNoticeProps

Props of BluetoothStateNotice.

Extends

Properties

PropertyTypeDescriptionInherited from
bleManager?BleManagerBLE manager used to read the Bluetooth state.-
copy?Partial<Record< | "unsupported" | BluetoothPermissionStatus | "on" | "off" | "unauthorized", BluetoothStateNoticeCopy>>Per-state text overrides.-
onOpenSettings?() => void | Promise<void>Opens the settings screen; defaults to the OS Bluetooth or app settings.-
requestPermission?() => Promise<boolean>Requests Bluetooth permission; resolves true when granted.-
settingsAction?stringLabel that forces the settings action button.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier of the notice.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
title?stringOverrides the notice heading.-

CalendarDayMarker

Highlight applied to a calendar day.

Properties

PropertyTypeDescription
backgroundColor?stringBackground color of the day cell.
color?stringText color of the day.
dateCalendarDateInputDay to mark.
label?stringAccessibility label for the marked day.
rangePosition?"start" | "end" | "middle" | "single"Position of the day within a highlighted range.

CalendarProps

Props of Calendar.

Extends

Properties

PropertyTypeDescriptionInherited from
defaultSelectedDate?CalendarDateInputInitial selected date when uncontrolled.-
defaultVisibleMonth?CalendarDateInputInitial visible month when uncontrolled.-
getMarkerForDate?(date) => CalendarDayMarker | undefinedResolves the marker for a date.-
isDateDisabled?(date) => booleanReturns true for dates that cannot be selected.-
labelForDate?(date) => stringReturns the accessibility label for a date.-
locale?stringBCP 47 locale for month and weekday names.-
markers?readonly CalendarDayMarker[]Day markers to display.-
maxDate?CalendarDateInputLatest selectable date.-
minDate?CalendarDateInputEarliest selectable date.-
nextMonthLabel?stringAccessibility label of the next-month button.-
onDateSelect?(date) => voidCalled when the user selects a date.-
onVisibleMonthChange?(month) => voidCalled when the visible month changes.-
previousMonthLabel?stringAccessibility label of the previous-month button.-
selectedDate?CalendarDateInput | nullControlled selected date; null clears the selection.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier prefix.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
visibleMonth?CalendarDateInputControlled visible month.-
weekStartsOn?WeekStartsOnFirst day of the week.-

EcgStripViewerProps

Props of EcgStripViewer.

Extends

Properties

PropertyTypeDescriptionInherited from
gain?numberGain in millimetres per millivolt. Standard ECG paper uses 10.-
initialPage?numberPage shown first, 0-based.-
onPageChange?(page, pageCount) => voidCalled when the page changes with the page index and page count.-
pageDurationSeconds?numberSeconds of ECG shown per page.-
sampleRatenumberSamples per second.-
samplesreadonly number[]ECG samples in millivolts, in chronological order.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
speed?numberSpeed in millimetres per second. Standard ECG paper uses 25.-
testID?stringTest identifier of the viewer.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme

FlowFrameProps

Props of FlowFrame.

Extends

Properties

PropertyTypeDescriptionInherited from
backLabel?stringLabel of the back button.-
children?ReactNodeMain content.-
contentStyle?StyleProp<ViewStyle>Style of the layout container.-
currentStep?numberCurrent step, 1-based, for the progress bar.-
footer?ReactNodeContent pinned to the bottom.-
handleAndroidBack?booleanWhether the Android back button calls onBack.-
header?ReactNodeExtra content below the heading and progress bar.-
keyboardBehavior?"height" | "padding" | "position"How the layout avoids the keyboard.-
keyboardVerticalOffset?numberVertical offset for keyboard avoidance.-
onBack?() => boolean | voidCalled when the back button or Android back is pressed; return false to let Android handle it.-
progressAccessibilityLabel?stringAccessibility label of the progress bar.-
safeAreaEdges?Edge[]Safe area edges to respect.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
title?stringHeading shown in the header.-
totalSteps?numberTotal steps for the progress bar.-

HealthImportCardProps

Props of HealthImportCard.

Extends

Type Parameters

Type ParameterDefault type
TType extends stringstring

Properties

PropertyTypeDescriptionInherited from
adapterHealthImportAdapter<TType>Platform adapter that reads and authorizes health data.-
background?booleanWhether to also enable background import.-
labelForType?(type) => stringReturns the display label of a data type.-
progress?Partial<Record<TType, SyncProgress>>Sync progress per data type.-
reasonLabels?Partial<Record<NonNullable<SyncPauseReason | undefined>, string>>Overrides the progress reason texts.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
statusLabels?Partial<Record<"started" | "completed" | "failed" | "idle" | "syncing" | "paused", string>>Overrides the progress status texts.-
testID?stringTest identifier of the card.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
title?stringCard heading.-
typesreadonly TType[]Health data types to import.-

ManualEntryFormProps

Props of ManualEntryForm.

Extends

Properties

PropertyTypeDescriptionInherited from
initialValues?Partial<Record<string, number>>Prefilled values keyed by field.-
labelForField?(field) => stringReturns the display label of a field.-
labelForUnit?(unit) => stringReturns the display label of a unit.-
measurementTypeKeyMeasurementTypeKeyMeasurement type whose fields the form shows.-
onSaved?(input) => voidCalled after the measurement is saved.-
recordedAt?DateInitial measurement time.-
saveMeasurement(input) => Promise<unknown>Persists the entered measurement; a rejection is shown as the form error.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier of the form.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
title?stringForm heading.-

ManualEntrySaveInput

Measurement the user entered by hand.

Properties

PropertyTypeDescription
dataRecord<string, number>Entered values keyed by field.
measurementTypeKeyMeasurementTypeKeyType of the measurement.
recordedAtDateWhen the measurement was taken.

MeasurementReading

One chart reading.

Properties

PropertyTypeDescription
atnumberTimestamp of the reading, epoch milliseconds.
valuesnumber[]Values of each plotted series at that time.

MeasurementTrendChartProps

Props of MeasurementTrendChart.

Extends

Properties

PropertyTypeDescriptionInherited from
height?numberChart height in pixels.-
normalRange?readonly [number, number]Shaded normal range as [min, max].-
readingsreadonly MeasurementReading[]Readings to plot in time order.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier of the chart.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
thresholds?readonly number[]Values drawn as dashed lines.-
width?numberChart width in pixels.-

NearbyDevicePromptProps

Props of NearbyDevicePrompt.

Extends

Properties

PropertyTypeDescriptionInherited from
declinedStorageKey?stringKey under which declined devices are stored.-
enabled?booleanWhether the prompt may appear.-
hint?stringExtra text shown under the title; {{name}} is replaced by the device name.-
labels?Record<string, string>Overrides the visible copy.-
onError?(error, device?) => voidCalled when pairing fails.-
onPaired?(device) => voidCalled after the device is paired.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
storagePairedDeviceStorageStorage used to remember paired devices.-
storageKey?stringKey under which paired devices are stored.-
testID?stringTest identifier of the modal.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme

OvokUiProps

Theme and slot customisation accepted by SDK UI components.

Extended by

Properties

PropertyTypeDescription
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.

OvokUiSlots

Replaceable UI primitives.

Properties

PropertyTypeDescription
ActivityIndicatorComponentType<ViewProps & RefAttributes<View> & object>Loading indicator primitive.
ButtonComponentType<Omit<Props, "ref"> & RefAttributes<View>>Button primitive.
CardComponentType<( | Omit<OutlinedCardProps & $Omit<Omit<Props, "ref"> & RefAttributes<View>, "mode"> & object, "ref"> | Omit<ElevatedCardProps & $Omit<Omit<Props, "ref"> & RefAttributes<View>, "mode"> & object, "ref"> | Omit<ContainedCardProps & $Omit<Omit<Props, "ref"> & RefAttributes<View>, "mode"> & object, "ref">) & RefAttributes<View>>Card primitive.
SwitchComponentType<SwitchProps & RefAttributes<Switch> & object>Switch primitive.
TextComponentType<TextProps & object & object>Text primitive.
TextInputComponentType<TextInputProps & RefAttributes<TextInput> & object & RefAttributes<TextInputHandles>>Text input primitive.
UrineAnalyteRowComponentType<UrineAnalyteRowProps>Row used to render a urine test analyte.

PairingFlowProps

Props of PairingFlow.

Extends

Properties

PropertyTypeDescriptionInherited from
getDeviceImage?(device) => string | undefinedReturns an image URI for a device.-
labels?Record<string, string>Override visible copy, including keys from BluetoothErrorCode.-
onError?(error, device?) => voidCalled when pairing fails.-
onPaired?(device) => voidCalled after a device is paired.-
onPairingCode?(code, device) => void | Promise<void>Called with the code the user enters when the device requires one.-
renderDevice?(device, actions) => ReactNodeReplaces the default device row; return undefined to keep the default.-
renderEmpty?(state) => ReactNodeRenders content when no device is found.-
renderHeader?(state) => ReactNodeRenders content above the device list.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
storagePairedDeviceStorageStorage used to remember paired devices.-
storageKey?stringKey under which paired devices are stored.-
testID?stringTest identifier of the root view.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme

PeriodDateRange

Inclusive date range of a period.

Properties

PropertyTypeDescription
endDateCalendarDateInputLast day of the period.
startDateCalendarDateInputFirst day of the period.

SupportedDevicesCatalogListProps

Props of SupportedDevicesCatalogList.

Extends

Properties

PropertyTypeDescriptionInherited from
devices?readonly SupportedDeviceDefinition[]Devices to list; defaults to the supported device catalog.-
labelForMeasurementType?(type) => stringReturns the display label of a measurement type.-
onSelect?(device) => voidCalled when the user selects a device.-
renderCredit?(device) => ReactNodeReplaces the image credit line.-
renderManual?(device) => ReactNodeReplaces the manual link.-
renderMeasurementTypes?(device) => ReactNodeReplaces the measured types line.-
renderPairingTips?(device) => ReactNodeReplaces the pairing tips.-
renderPhoto?(device) => ReactNodeReplaces the device photo.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier of the list.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme

UrineAnalyteRowProps

Props of a custom urine analyte row slot.

Properties

PropertyTypeDescription
accessibilityLabelstringScreen reader label for the row.
analyteKeystringStable key of the analyte.
isOutsideUsualRangebooleanWhether the value is outside the usual range.
namestringDisplay name of the analyte.
rangeLabel?stringFormatted usual range, when known.
themeOvokThemeResolved theme to render with.
valuestringFormatted measured value.

UrineTestResultProps

Props of UrineTestResult.

Extends

Properties

PropertyTypeDescriptionInherited from
accessibilityLabelForAnalyte?(key, fallback) => stringReturns the screen reader label of an analyte row.-
labelForAnalyte?(key, fallback) => stringReturns the display label of an analyte given its key and default label.-
measurementUrineAnalyzeMeasurementUrine analysis measurement to display.-
showOnlyMeasured?booleanHides analytes that have no value.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier of the card.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme

Type Aliases

OvokTheme

type OvokTheme = MD3Theme & object;

React Native Paper MD3 theme extended with spacing and radius helpers.

Type Declaration

NameTypeDescription
borderRadius()(value) => numberConverts a radius unit to pixels.
fontFamily?stringFont family applied to SDK text.
spacing()(value) => numberConverts a spacing unit to pixels.

OvokThemeOverride

type OvokThemeOverride = Partial<Omit<OvokTheme, "colors" | "fonts">> & object;

Partial theme merged over the active theme.

Type Declaration

NameTypeDescription
colors?Partial<OvokTheme["colors"]>Color overrides.
fonts?Partial<OvokTheme["fonts"]>Font overrides.

PairingFlowRenderState

type PairingFlowRenderState = object;

State passed to the custom render callbacks.

Properties

devices
devices: readonly RuntimeDevice[];

Nearby devices found.

error?
error?: string;

Message of the last pairing error.

paired
paired: readonly string[];

IDs of the remembered devices.

selected?
selected?: RuntimeDevice;

Device being paired.

status
status: PairingFlowStatus;

Current pairing status.


PairingFlowStatus

type PairingFlowStatus = "idle" | "pairing" | "code-required" | "paired" | "error";

Stage of the pairing flow.


PeriodCalendarProps

type PeriodCalendarProps = Omit<CalendarProps, "markers" | "getMarkerForDate"> & object;

Props of PeriodCalendar: calendar props except markers.

Type Declaration

NameTypeDescription
labelForPeriodDate()?(date) => stringReturns the accessibility label of a period day.
periodLabel?stringAccessibility label and legend text for period days.
periodsreadonly PeriodDateRange[]Date ranges to highlight; overlapping or adjacent ranges are merged.
showLegend?booleanWhether to show the legend.

PrerequisiteGateProps

type PrerequisiteGateProps<T> = object;

Props of PrerequisiteGate.

Type Parameters

Type Parameter
T

Properties

check
check: () => Promise<T | null | undefined>;

Load account-scoped requirements from the host's authorized data source.

Returns

Promise<T | null | undefined>

children
children: React.ReactNode;

Content rendered once no requirement is pending.

onError?
onError?: (error) => void;

Check failures fail open; use this callback for logging or telemetry.

Parameters
ParameterType
errorunknown
Returns

void

pending?
pending?: React.ReactNode;

Shown while checking. Defaults to nothing, so protected children never flash.

renderRequired
renderRequired: (requirement, refresh) => React.ReactNode;

Render the required task and call refresh after its save succeeds.

Parameters
ParameterType
requirementT
refresh() => void
Returns

React.ReactNode

scopeKey
scopeKey: string;

Identifies the account scope; changing it re-runs the check.


ResolvedOvokUiSlots

type ResolvedOvokUiSlots = Omit<OvokUiSlots, "UrineAnalyteRow"> & Partial<Pick<OvokUiSlots, "UrineAnalyteRow">>;

Slots after useOvokUi fills the react-native-paper defaults; only UrineAnalyteRow stays optional.

Last updated on

On this page

ComponentsCalendarMeasurementTrendChartSparklineBackgroundSyncSetting()ParametersReturnsBluetoothStateNotice()ParametersReturnsEcgStripViewer()ParametersReturnsFlowFrame()ParametersReturnsHealthImportCard()Type ParametersParametersReturnsManualEntryForm()ParametersReturnsNearbyDevicePrompt()ParametersReturnsPairingFlow()ParametersReturnsPeriodCalendar()ParametersReturnsPrerequisiteGate()Type ParametersParametersReturnsSupportedDevicesCatalogList()ParametersReturnsUrineTestResult()ParametersReturnsHooksuseOvokUi()ParametersReturnsFunctionsmergeOvokTheme()ParametersReturnsInterfacesBackgroundSyncSettingPropsExtendsPropertiesBluetoothStateNoticeCopyPropertiesBluetoothStateNoticePropsExtendsPropertiesCalendarDayMarkerPropertiesCalendarPropsExtendsPropertiesEcgStripViewerPropsExtendsPropertiesFlowFramePropsExtendsPropertiesHealthImportCardPropsExtendsType ParametersPropertiesManualEntryFormPropsExtendsPropertiesManualEntrySaveInputPropertiesMeasurementReadingPropertiesMeasurementTrendChartPropsExtendsPropertiesNearbyDevicePromptPropsExtendsPropertiesOvokUiPropsExtended byPropertiesOvokUiSlotsPropertiesPairingFlowPropsExtendsPropertiesPeriodDateRangePropertiesSupportedDevicesCatalogListPropsExtendsPropertiesUrineAnalyteRowPropsPropertiesUrineTestResultPropsExtendsPropertiesType AliasesOvokThemeType DeclarationOvokThemeOverrideType DeclarationPairingFlowRenderStatePropertiesdeviceserror?pairedselected?statusPairingFlowStatusPeriodCalendarPropsType DeclarationPrerequisiteGatePropsType ParametersPropertiescheckReturnschildrenonError?ParametersReturnspending?renderRequiredParametersReturnsscopeKeyResolvedOvokUiSlots