Development Guide
This guide covers development workflows and tools available when working on the SDK.
Component Generator
We provide an interactive component generator to help maintain consistent structure across the SDK. This tool helps ensure that new components follow our architectural patterns and include all necessary boilerplate.
Usage
bash
yarn create-component
The generator will prompt you for three pieces of information:
Component Name: The name of your new component in PascalCase (e.g., "UserTile", "TierTile", etc.)
Component Type: The architectural category of your component:
atoms
: Basic building blocks (e.g., text, buttons, inputs)molecules
: Simple combinations of atomsorganisms
: Complex combinations of moleculesparticles
: Smallest UI elementstemplates
: Page-level components
Base Directory: Where to create the component (defaults to
./lib/components
)
Generated Structure
The generator will create a new directory for your component with the following structure:
ComponentName/
├── index.tsx # Main component file
├── ComponentName.stories.tsx # Storybook stories
Best Practices
When using the component generator:
- Always use PascalCase for component names (e.g., "ButtonGroup" not "button-group" or "buttonGroup")
- Choose the appropriate component type based on atomic design principles
- Keep components focused and single-purpose
- Place shared styles in the theme system rather than component-specific files