Generate Consistent UI Code with Design Tokens
Token-based React Native design system reference - Box, HStack/VStack, Button, Input, Card components, and spacing/color/typography tokens.
Why it matters
Ensure UI consistency and maintainability by generating code that strictly adheres to a design system's core components and design tokens. This skill promotes a unified look and feel across applications.
Outcomes
What it gets done
Generate UI components using predefined design tokens for spacing, color, and typography.
Create layout structures like Box, HStack, VStack, and Screen layouts.
Implement interactive elements such as Buttons and Input fields with consistent styling.
Ensure all generated code avoids hard-coded values and uses semantic tokens.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-core-components | bash Overview
Core Components
A React Native design-system reference defining spacing, color, and typography tokens plus core component APIs (Box, HStack/VStack, Button, Input, Card) and anti-patterns to avoid. Use when building or reviewing React Native UI in a codebase built on this token-based core component library.
What it does
A React Native design-system reference for using token-based core components (Box, HStack/VStack, Text, Button, Input, Card) instead of raw platform components or hard-coded values. Defines the token scales: spacing tokens $1-$8 (4px to 32px), semantic color tokens ($textPrimary, $textSecondary, $textTertiary, $primary500, $statusError, $statusSuccess), and typography size tokens $xs-$2xl (12px to 24px). Documents each core component's API - Box as the base layout primitive, HStack/VStack for flex layouts, Text and Button (with solid, outline, ghost, and link variants) for typography and actions, Input with label, error, and placeholder props for forms, and Card with CardHeader and CardBody for content containers - plus common layout patterns for a full screen (Screen, ScreenHeader, ScreenContent), a form (stacked Inputs plus a loading Button), and a list item row (Avatar, title/subtitle VStack, chevron icon). Anti-patterns are shown side by side with the fix: hard-coded padding or colors in inline styles versus token props, importing raw View or Text from react-native versus importing Box or Text from components/core. Also shows a component-props pattern for building new components that accept only token values (for example padding?: '$2' | '$4' | '$6') rather than arbitrary numbers.
When to use - and when NOT to
Use when building or reviewing React Native UI screens, forms, or list views in a codebase that has this token-based core component library, and when writing new reusable components that should accept token values rather than raw numbers or hex colors. Not applicable to codebases without this design system's token setup, or to web-only React projects using a different component library - the API surface (Box, HStack, VStack, dollar-prefixed tokens) is specific to this system.
Inputs and outputs
Input is a UI requirement - a screen, form, list, or card. Output is JSX built from the core component set with token props instead of raw style objects, following the documented layout patterns for screens, forms, and list rows.
// WRONG - Hard-coded values
<View style={{ padding: 16, backgroundColor: '#fff' }}>
// CORRECT - Design tokens
<Box padding="$4" backgroundColor="$backgroundPrimary">
// WRONG - Raw platform components
import { View, Text } from 'react-native';
// CORRECT - Core components
import { Box, Text } from 'components/core';
Integrations
Works with the react-ui-patterns skill for managing UI states, the testing-patterns skill for mocking core components in tests, and Storybook for documenting component variants.
Who it's for
React Native developers working in a codebase built on this token-based design system who need the exact token names, component props, and layout patterns rather than re-deriving them from the library's source.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.