Skip to content

Spacing

Synchronicity uses a base-4 spacing scale that creates harmonious, consistent layouts. The scale provides enough granularity for precise control while maintaining visual rhythm.

space-14px
space-28px
space-312px
space-416px
space-520px
space-624px
space-832px
space-1040px
space-1248px
space-1664px
space-2080px
space-2496px

Map raw spacing values to semantic purposes:

TokenValueUsage
xs4pxTight spacing, icon gaps
sm8pxCompact elements, inline spacing
md16pxStandard padding, card spacing
lg24pxSection spacing, generous padding
xl32pxMajor sections, screen padding
2xl48pxHero spacing, large gaps
3xl64pxPage sections, major dividers

Specific tokens for common layout patterns:

const layout = {
screenPadding: 16, // Horizontal screen margins
sectionGap: 32, // Between major sections
cardPadding: 16, // Inside cards
listItemGap: 12, // Between list items
inlineGap: 8, // Between inline elements
iconTextGap: 8, // Between icon and label
};

Minimum sizes for interactive elements:

TokenSizeUsage
touch-min44pxMinimum touch target (Apple HIG)
touch-comfortable48pxComfortable touch size
touch-large56pxPrimary action buttons
import { useTheme } from '@synchronicity/react-native';
function HexagramCard({ hexagram }) {
const { spacing } = useTheme();
return (
<View style={{
padding: spacing.md,
marginBottom: spacing.lg,
gap: spacing.sm,
}}>
<Text>{hexagram.name}</Text>
<Text>{hexagram.description}</Text>
</View>
);
}

Or use primitives directly:

import { spacing } from '@synchronicity/tokens/primitives';
const styles = StyleSheet.create({
container: {
padding: spacing['space-4'],
gap: spacing['space-2'],
},
});
  1. Use the scale - Avoid arbitrary pixel values; stick to the scale
  2. Be consistent - Same spacing for same relationships across screens
  3. Create breathing room - Contemplative apps need generous whitespace
  4. Consider touch - Interactive elements need adequate spacing
Screen edge padding → xl (32px)
Section gaps → 2xl (48px)
Card padding → md (16px)
List item gaps → sm (8px)
Inline element gaps → xs (4px)

This creates a clear visual hierarchy where major divisions have more space than minor ones.