Skip to content

TrigramVisual

Renders a single I Ching trigram (3 lines) with optional labels and Chinese characters. Includes utilities for displaying trigram pairs and grids.

import { TrigramVisual, TrigramPair, TrigramGrid } from '@synchronicity/react-native';
NameChineseSymbolLines
Heaven乾 (qián)━━━ ━━━ ━━━
Earth坤 (kūn)━ ━ ━ ━ ━ ━
Thunder震 (zhèn)━ ━ ━ ━ ━━━
Water坎 (kǎn)━ ━ ━━━ ━ ━
Mountain艮 (gèn)━━━ ━ ━ ━ ━
Wind巽 (xùn)━━━ ━━━ ━ ━
Fire離 (lí)━━━ ━ ━ ━━━
Lake兌 (duì)━ ━ ━━━ ━━━
<TrigramVisual name="heaven" />
<TrigramVisual name="earth" />
<TrigramVisual name="fire" />
<TrigramVisual name="heaven" showLabel />
<TrigramVisual name="water" showLabel showChinese />

Specify lines directly (bottom, middle, top where true = yang):

<TrigramVisual lines={[true, false, true]} />
<TrigramVisual name="thunder" size="sm" />
<TrigramVisual name="thunder" size="md" />
<TrigramVisual name="thunder" size="lg" />

Shows upper and lower trigrams with labels:

<TrigramPair
upper="heaven"
lower="earth"
showLabels
/>

Displays all 8 trigrams in a grid:

<TrigramGrid
size="sm"
columns={4}
selected="fire"
onSelect={(name) => console.log(name)}
/>
PropTypeDefaultDescription
nameTrigramName-Trigram by name
lines[boolean, boolean, boolean]-Lines directly (bottom, middle, top)
size'sm' | 'md' | 'lg''md'Size of trigram
showLabelbooleanfalseShow trigram name
showChinesebooleanfalseShow Chinese character
labelColorstring-Custom label color
styleViewStyle-Custom styles
PropTypeDefaultDescription
upperTrigramNamerequiredUpper trigram name
lowerTrigramNamerequiredLower trigram name
size'sm' | 'md' | 'lg''md'Size of trigrams
showLabelsbooleantrueShow “Upper”/“Lower” labels
styleViewStyle-Custom styles
PropTypeDefaultDescription
size'sm' | 'md''sm'Size of each trigram
columns4 | 84Number of columns
selectedTrigramName-Currently selected trigram
onSelect(name: TrigramName) => void-Selection handler
styleViewStyle-Custom styles
type TrigramName =
| 'heaven'
| 'earth'
| 'thunder'
| 'water'
| 'mountain'
| 'wind'
| 'fire'
| 'lake';