Skip to content

ReadingCard

A card component for displaying I Ching reading summaries with hexagram visualization, metadata, and navigation.

import { ReadingCard, ReadingCardCompact } from '@synchronicity/react-native';
<ReadingCard
hexagramNumber={1}
name="The Creative"
chineseName=""
lines={['yang', 'yang', 'yang', 'yang', 'yang', 'yang']}
/>
<ReadingCard
hexagramNumber={11}
name="Peace"
chineseName=""
lines={['yang', 'yang', 'yang', 'yin', 'yin', 'yin']}
date={new Date()}
question="What should I focus on this week?"
/>

When a reading has changing lines, show the transformation:

<ReadingCard
hexagramNumber={1}
name="The Creative"
chineseName=""
lines={['changing-yang', 'yang', 'yang', 'yang', 'yang', 'yang']}
hasChangingLines={true}
transformedNumber={44}
transformedName="Coming to Meet"
/>
<ReadingCard
hexagramNumber={29}
name="The Abysmal"
chineseName=""
lines={['yin', 'yang', 'yin', 'yin', 'yang', 'yin']}
date={new Date('2024-01-15')}
onPress={() => navigation.navigate('ReadingDetail', { id: 123 })}
/>
<ReadingCard {...props} size="sm" />
<ReadingCard {...props} size="md" />
<ReadingCard {...props} size="lg" />

For use in lists where space is limited:

<ReadingCardCompact
hexagramNumber={1}
name="The Creative"
lines={['yang', 'yang', 'yang', 'yang', 'yang', 'yang']}
date={new Date()}
onPress={() => handleSelect(1)}
/>
<FlatList
data={readings}
renderItem={({ item }) => (
<ReadingCardCompact
hexagramNumber={item.hexagramNumber}
name={item.name}
lines={item.lines}
date={item.date}
onPress={() => navigation.navigate('Reading', { id: item.id })}
/>
)}
ItemSeparatorComponent={() => <View style={{ height: 12 }} />}
/>
PropTypeDefaultDescription
hexagramNumbernumberrequiredHexagram number (1-64)
namestringrequiredHexagram name
chineseNamestring-Chinese name
linesLineType[]requiredArray of 6 line types
dateDate-Reading date
questionstring-Question or intention
hasChangingLinesboolean-Whether reading has changing lines
transformedNumbernumber-Transformed hexagram number
transformedNamestring-Transformed hexagram name
onPress() => void-Press handler
size'sm' | 'md' | 'lg''md'Card size
styleViewStyle-Custom styles
PropTypeDefaultDescription
hexagramNumbernumberrequiredHexagram number
namestringrequiredHexagram name
linesLineType[]requiredArray of 6 line types
dateDate-Reading date
onPress() => void-Press handler
styleViewStyle-Custom styles
  • Interactive cards use accessibilityRole="button"
  • Cards provide descriptive accessibilityLabel
  • Press states are indicated visually with opacity change