Tile.Title
Simple title text component that displays measurement task names with consistent typography and theme integration.
Quick Example
import { Tile } from "@ovok/native";
import React from "react";
const TitleExample = () => {
return (
<Tile>
<Tile.Title testID="measurement-title">
Blood Pressure Measurement
</Tile.Title>
</Tile>
);
};
export default TitleExample;
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
children | ReactNode | ✓ | - | Text content to display as title |
style | StyleProp<TextStyle> | - | - | Custom text styles |
testID | string | - | - | Test identifier for automated testing |
Component Behavior
The Title component renders text using React Native Paper's Text component with:
- Typography: Uses
titleLargevariant from Material Design 3 - Font Family: Custom font "DMSans_700Bold" for enhanced readability
- Font Size: Fixed at 16px for consistent hierarchy
- Style Merging: Combines default styles with custom styles passed via props
Localization
This component does not handle localization directly. Translation should be handled by the parent component:
import { useTranslation } from "react-i18next";
export const LocalizedTitleExample = () => {
const { t } = useTranslation();
return (
<Tile>
<Tile.Title>{t("measurements.bloodPressure.title")}</Tile.Title>
</Tile>
);
};
Common translation keys used with Tile.Title:
{
"tile": {
"bloodPressure": {
"label": "Blood Pressure"
},
"bloodGlucose": {
"label": "Blood Glucose"
},
"bodyWeight": {
"label": "Body Weight"
},
"temperature": {
"label": "Temperature"
}
}
}
Styling
Theme Colors Used
This component uses the default text color from the theme through React Native Paper's Text component.
Accessibility Features
- Semantic Role: Inherits proper text semantics from React Native Paper
- Screen Reader: Text content is automatically read by screen readers
- Font Scaling: Respects user's system font size preferences
- High Contrast: Works with system accessibility settings
Related Components
- Tile.StartSection - Header section that typically precedes the title
- Tile.MeasuredValue - Value display that typically follows the title
- Tile.Status - Status text component with similar styling