DiaryCard
The DiaryCard component is a specialized interactive card designed for displaying health measurement data and diary entries. It extends TouchableOpacity with healthcare-specific styling and automatic visual state management based on data availability.
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
The DiaryCard component is a specialized interactive card designed for displaying health measurement data and diary entries. It extends TouchableOpacity with healthcare-specific styling and automatic visual state management based on data availability.
Basic Example
import { MeasurementTypeKey } from "@ovok/core/next";
import { DiaryCard } from "@ovok/native";
import * as React from "react";
const BasicDiaryCardExample = () => {
return (
<DiaryCard hasData={false}>
<DiaryCard.StartSection
left={() => (
<DiaryCard.TaskIcon
measurementTypeKey={MeasurementTypeKey.bodyWeight}
/>
)}
/>
<DiaryCard.Title>Body Weight</DiaryCard.Title>
<DiaryCard.MeasuredValue value={"70"} unit={"kg"} time="15:34" />
</DiaryCard>
);
};
export default BasicDiaryCardExample;Props
Every prop, with its type and description, is listed in the @ovok/native/diary API reference.
Compound Components
DiaryCardProps is exported from @ovok/native for typing wrappers around the card.
DiaryCard.StartSection- Header section with icon and optional right contentDiaryCard.TaskIcon- Measurement type icons (inherited from Tile module)DiaryCard.Title- Card title text (inherited from Tile module)DiaryCard.MeasuredValue- Value display with unit and timestamp (inherited from Tile module)DiaryCard.NoData- Empty state indicator for unmeasured data
Component Behavior
Visual State Management
The card automatically adjusts its appearance based on the hasData prop:
Has Data (hasData = true):
- Background:
theme.colors.surface - Full opacity and normal interaction
- Standard shadow and elevation
No Data (hasData = false):
- Background:
theme.colors.surfaceDisabled - Reduced visual prominence
- Maintains touch interaction for data entry
Theme Integration
- Background Colors: Uses Material Design 3 surface colors
- Border:
theme.colors.outlineVariantwith hairline width - Shadow:
theme.colors.shadowwith consistent elevation - Spacing:
theme.spacing(4)padding andtheme.spacing(2)gap - Border Radius:
theme.borderRadius(4)for consistent rounding
Styling
Theme Colors Used
theme.colors.surface- Default card backgroundtheme.colors.surfaceDisabled- Background when no data is availabletheme.colors.outlineVariant- Border colortheme.colors.shadow- Shadow color for elevation
Related Components
- DiaryCard.StartSection - Header section component
- DiaryCard.NoData - Empty state component
- Tile Module - Source of inherited compound components
Last updated on
Diary
A specialized card component system for displaying health measurement data and diary entries in healthcare applications. The Diary module provides interactive cards with measurement display capabilities, designed for medical tracking and patient monitoring workflows.
DiaryCard.MeasuredValue
Displays a measured value with unit and timestamp. Inherited from the Tile module and themed for consistency across diary cards.