Skip to content

ReadingListItem

ReadingListItem displays a reading entry in lists with hexagram visual, animated transitions for changing lines, and context menu support.

1. 乾 · QiánThe Creative
Today

When a reading has changing lines, the item shows animated transitions between current and future hexagrams.

1. 乾 · Qián The Creative
Yesterday
<ReadingListItem
reading={{
hexagramNumber: 1,
hexagramName: "The Creative",
changingLines: [2, 4],
futureHexagram: 44,
timestamp: Date.now(),
}}
onPress={handlePress}
/>

1
1. 乾 · QiánThe Creative
2
Today3
4
ElementDescription
1. Hexagram VisualTiny hexagram with optional changing line indicators
2. Reading InfoNumber, Chinese name, pinyin, English name
3. MetaRelative date (Today, Yesterday, or date)
4. ChevronNavigation indicator

For readings with changing lines, text and hexagram visuals animate in sync:

  1. Current state fades out and slides left
  2. Future state fades in and slides from right
  3. Animations loop continuously using shared Animated.Value

This creates a unified visual that shows transformation.


PropTypeDefaultDescription
readingReading-Reading data object
onPress(reading: Reading) => void-Press handler
showDatebooleantrueShow date in meta area
formatDate(timestamp: number) => string-Custom date formatter
interface Reading {
id: string;
hexagramNumber: number;
hexagramName: string;
hexagramChinese: string;
timestamp: number;
question?: string;
changingLines: number[];
futureHexagram?: number;
}

Long-press triggers a context menu with quick actions:

  • View Details
  • Share Reading
  • Delete Reading
<HexagramContextMenu
hexagramNumber={reading.hexagramNumber}
hexagramName={reading.hexagramName}
changingLines={reading.changingLines}
futureHexagramNumber={reading.futureHexagram}
onViewDetails={handlePress}
>
<TouchableOpacity ...>
{/* Item content */}
</TouchableOpacity>
</HexagramContextMenu>

  • Role: accessibilityRole="button"
  • Label: Full description including hexagram number, name, and transition
  • Hint: Instructions for interaction
accessibilityLabel="1. The Creative, 乾 Qián, changing to Breakthrough"
accessibilityHint="Reading from Today. Tap to view details."

import { ReadingListItem } from '@synchronicity/react-native';
import { FlatList } from 'react-native';
function ReadingsList({ readings, onReadingPress }) {
return (
<FlatList
data={readings}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<ReadingListItem
reading={item}
onPress={onReadingPress}
showDate={true}
/>
)}
ItemSeparatorComponent={() => <View style={{ height: 8 }} />}
/>
);
}