GuidesComponentsdiary

DiaryCard.NoData

The DiaryCard.NoData component displays a localized message indicating that no measurement data is available. It provides consistent empty state messaging for diary cards with internationalization support and theme-aware styling.

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

The DiaryCard.NoData component displays a localized message indicating that no measurement data is available. It provides consistent empty state messaging for diary cards with internationalization support and theme-aware styling.

Basic Example

import { MeasurementTypeKey } from "@ovok/core/next";
import { DiaryCard } from "@ovok/native";
import * as React from "react";

const BasicDiaryCardNoDataExample = () => {
  return <DiaryCard.NoData />;
};

export default BasicDiaryCardNoDataExample;

Props

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

Localization

The component uses the "diary.no-data" translation key. Ensure this key is defined in your translation files:

{
  "diary": {
    "no-data": "No data recorded"
  }
}

Theme Integration

  • Text Color: Uses theme.colors.onSurfaceDisabled for muted appearance
  • Typography: Custom font family DMSans_700Bold with 16px size
  • Responsive: Adapts to system font size preferences

Visual Design

  • Muted Appearance: Subtle styling to indicate absence of data
  • Consistent Typography: Matches other secondary text in the app
  • Accessible Contrast: Maintains readable contrast ratios

Styling

Theme Colors Used

  • theme.colors.onSurfaceDisabled - Text color for muted appearance

Last updated on

On this page