Skip to content

Chip

Chip is a compact element used for categories, filters, or selections. Supports interactive and removable states.

HeavenEarthThunderWater

Solid background for emphasis.

DefaultSelected
<Chip>Default</Chip>
<Chip selected>Selected</Chip>

Border-only for subtle appearance.

DefaultSelected
<Chip variant="outlined">Default</Chip>
<Chip variant="outlined" selected>Selected</Chip>

Subtle background for minimal emphasis.

DefaultSelected
<Chip variant="soft">Default</Chip>
<Chip variant="soft" selected>Selected</Chip>

SmallMediumLarge
SizePaddingFontUsage
sm8×4px12pxCompact lists
md12×6px14pxDefault
lg16×8px16pxFeatured items

Chips can be selectable for filter-like behavior.

☰ Heaven☷ Earth☳ Thunder☵ Water☶ Mountain☴ Wind☲ Fire☱ Lake
const [selected, setSelected] = useState(['heaven', 'thunder', 'wind']);
const trigrams = ['Heaven', 'Earth', 'Thunder', 'Water', 'Mountain', 'Wind', 'Fire', 'Lake'];
<ChipGroup>
{trigrams.map(trigram => (
<Chip
key={trigram}
selected={selected.includes(trigram.toLowerCase())}
onPress={() => toggleSelection(trigram.toLowerCase())}
>
{trigram}
</Chip>
))}
</ChipGroup>

Add an onClose handler to show a remove button.

Heaven ×Earth ×Thunder ×
const [tags, setTags] = useState(['Heaven', 'Earth', 'Thunder']);
<ChipGroup>
{tags.map(tag => (
<Chip
key={tag}
onClose={() => setTags(prev => prev.filter(t => t !== tag))}
>
{tag}
</Chip>
))}
</ChipGroup>

☰ Heaven☷ Earth☳ Thunder
<Chip icon={<TrigramIcon name="heaven" />}>Heaven</Chip>
<Chip icon={<TrigramIcon name="earth" />}>Earth</Chip>
<Chip icon={<TrigramIcon name="thunder" />}>Thunder</Chip>

DisabledSelected disabled
<Chip disabled>Disabled</Chip>
<Chip selected disabled>Selected disabled</Chip>

Container for managing chip layout with consistent spacing.

RelationshipsCareerHealthSpiritualFinancialCreative
<ChipGroup spacing="sm">
<Chip variant="outlined">Relationships</Chip>
<Chip variant="outlined">Career</Chip>
<Chip variant="outlined">Health</Chip>
<Chip variant="outlined">Spiritual</Chip>
<Chip variant="outlined">Financial</Chip>
<Chip variant="outlined">Creative</Chip>
</ChipGroup>

PropTypeDefaultDescription
childrenstringRequiredChip label
variant'filled' | 'outlined' | 'soft''filled'Visual style
size'sm' | 'md' | 'lg''md'Chip size
selectedbooleanfalseSelected state
onPress() => void-Press handler
disabledbooleanfalseDisable interaction
iconReactNode-Icon before label
onClose() => void-Close handler (shows X)
styleViewStyle-Custom styles
PropTypeDefaultDescription
childrenReactNodeRequiredChip elements
spacing'sm' | 'md' | 'lg''sm'Gap between chips
styleViewStyle-Custom styles

import { Chip, ChipGroup, Card, Input } from '@synchronicity/react-native';
import { View, Text, StyleSheet } from 'react-native';
import { useState } from 'react';
function ReadingTagEditor({ reading, onUpdate }) {
const [tags, setTags] = useState(reading.tags || []);
const [newTag, setNewTag] = useState('');
const suggestedTags = ['Career', 'Love', 'Health', 'Guidance', 'Decision'];
const availableSuggestions = suggestedTags.filter(t => !tags.includes(t));
const addTag = (tag: string) => {
if (tag && !tags.includes(tag)) {
const updated = [...tags, tag];
setTags(updated);
onUpdate({ ...reading, tags: updated });
}
setNewTag('');
};
const removeTag = (tag: string) => {
const updated = tags.filter(t => t !== tag);
setTags(updated);
onUpdate({ ...reading, tags: updated });
};
return (
<Card>
<Text style={styles.title}>Tags</Text>
{tags.length > 0 && (
<ChipGroup spacing="sm" style={styles.section}>
{tags.map(tag => (
<Chip key={tag} onClose={() => removeTag(tag)}>
{tag}
</Chip>
))}
</ChipGroup>
)}
<Input
value={newTag}
onChangeText={setNewTag}
placeholder="Add custom tag..."
onSubmitEditing={() => addTag(newTag)}
accessibilityLabel="Add tag"
/>
{availableSuggestions.length > 0 && (
<View style={styles.section}>
<Text style={styles.sectionTitle}>Suggestions</Text>
<ChipGroup spacing="sm">
{availableSuggestions.map(tag => (
<Chip
key={tag}
variant="outlined"
onPress={() => addTag(tag)}
>
{tag}
</Chip>
))}
</ChipGroup>
</View>
)}
</Card>
);
}
const styles = StyleSheet.create({
title: {
fontSize: 18,
fontWeight: '600',
marginBottom: 16,
},
section: {
marginTop: 16,
},
sectionTitle: {
fontSize: 14,
color: '#8a8a9a',
marginBottom: 8,
},
});