ObservationDetail.PhotoPreview
An advanced photo gallery component with thumbnail navigation and full-screen modal preview. Built on FlashList for high performance with large photo sets and includes rotation, navigation, and zoom capabilities.
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
An advanced photo gallery component with thumbnail navigation and full-screen modal preview. Built on FlashList for high performance with large photo sets and includes rotation, navigation, and zoom capabilities.
Basic Example
import { ObservationDetail } from "@ovok/native";
import * as React from "react";
const photos = Array.from(
{ length: 10 },
(_, index) => `https://placehold.co/600x400/FFFFFF/000000/png?text=${index}`
);
const BasicPhotoPreview = () => (
<ObservationDetail.PhotoPreview photos={photos} />
);
export default BasicPhotoPreview;Props
Every prop, with its type and description, is listed in the @ovok/native/observation-detail API reference.
Component Behavior
Thumbnail Gallery
- Horizontal scrolling FlashList for performance
- Active photo highlighting with theme colors
- Touch selection for photo navigation
- Configurable thumbnail sizes and spacing
Modal Preview
- Full-screen photo viewing with animated transitions
- Left/right navigation between photos
- Rotation controls (90° increments)
- Safe area handling for modern devices
Performance Features
- FlashList optimization for large photo sets
- Efficient image loading and caching
- Smooth 60fps scrolling and transitions
- Memory-conscious image handling
Styling
Theme Colors Used
theme.colors.primary- Active thumbnail bordertheme.colors.surface- Modal button backgroundstheme.colors.onSurface- Modal button iconstheme.colors.outline- Modal button borderstheme.spacing(3)- Default gap between thumbnailstheme.borderRadius(2)- Thumbnail corner radiustheme.borderRadius(99)- Modal button corner radius
Modal Features
Navigation Controls
- Left/right arrow buttons for photo navigation
- Automatic disable on first/last photos
- Smooth transitions between images
Rotation Controls
- 90° rotation increments (left/right)
- Smooth animated rotations using react-native-reanimated
- Rotation state maintained per photo session
Performance Considerations
Large Image Sets
- FlashList optimization for 100+ photos
- Efficient viewport management and recycling
- Lazy loading of non-visible thumbnails
- Memory-conscious image caching
Image Loading
- OptimizedImage integration for efficient loading
- Placeholder and image-wrapper loading behavior; progressive rendering is not guaranteed by this component
- Placeholder handling during load states
- Error state management for failed loads
Last updated on
ObservationDetail
A scrollable container component designed for displaying healthcare observation data with automatic safe area handling and theme-based spacing. Serves as the main container for compound observation detail components.
ObservationDetail.Resource
A resource information component for displaying data source details with optional imagery. Used to indicate the origin or method of data collection in healthcare observations.