- Accordion
- Alert Dialog
- Avatar
- Badge
- Banner
- BreadcrumbSOON
- Button
- Button Group
- Calendar
- Callout
- Card
- Checkbox
- CodeblockSOON
- Color Picker
- Container
- Control Group
- Dialog
- Dropdown
- File Uploader
- FlexBox
- FormSOON
- Grid View
- IconSOON
- ImageSOON
- Input
- Link
- List
- MenuSOON
- PaginationSOON
- Popover
- Progress
- Radio
- Section
- Select
- Separator
- Skeleton
- SliderSOON
- SpinnerSOON
- Switch
- Table
- Tabs
- Tag
- Textarea
- ToastSOON
- Tooltip
CLI
The Sugarcoat CLI tool enables you to add components to your project using two different approaches - PnP (Plug-and-Play) or Custom installation.The Sugarcoat CLI provides a powerful way to integrate our design system into your projects. You can choose between two installation approaches based on your needs:
- PnP (Plug-and-Play): Install components as NPM dependencies
- Custom: Copy component source code directly into your project (like shadcn/ui)
Quick Start
Get started with Sugarcoat in under 2 minutes:
The setup wizard will detect your project type and guide you through the optimal configuration.
Installation
Install the Sugarcoat CLI globally or use it with npx:
Commands
sugarcoat setup
🎉 New! Interactive setup wizard for Sugarcoat. This is the recommended way to get started with Sugarcoat.
What the setup wizard does:
- Detects your project framework (Next.js, Vite, etc.)
- Recommends the best setup mode (PnP vs Custom)
- Configures TypeScript paths automatically
- Installs required dependencies
- Sets up Panda CSS (Custom mode)
- Adds starter components
- Verifies setup with built-in diagnostics
Available presets:
nextjs- Optimized for Next.js projectsvite- Optimized for Vite projectsdefault- Generic setup for any React project
sugarcoat init (Legacy)
Initialize Sugarcoat in your project. This command sets up the necessary configuration files and dependencies.
Note: This command is deprecated. Use
sugarcoat setupinstead for a better experience.
What this does:
- Creates
sugarcoat.jsonconfiguration file - Installs
@sugarcoat/design-systemdependency - Updates TypeScript paths in
tsconfig.json - Ready to use components immediately
Best for:
- Quick prototyping
- Projects that don't need component customization
- Teams wanting to stay up-to-date with latest versions
sugarcoat add
Add a component to your project. The CLI will handle dependencies and file placement automatically.
What this does:
- Fetches component source code from registry
- Installs required dependencies (like @radix-ui packages)
- Resolves and installs utility files (lib, types)
- Processes import paths based on your configuration
- Updates component tracking in
sugarcoat.json
sugarcoat list
List all available components in the registry.
sugarcoat generate
Generate design system files (Custom mode only).
sugarcoat sync
Sync configuration files and ensure everything is up-to-date.
sugarcoat doctor
Run comprehensive diagnostics to check your Sugarcoat setup and identify potential issues.
What this checks:
- Configuration file validity
- TypeScript path mapping
- Required dependencies
- Directory structure
- Panda CSS setup (Custom mode)
- Installed component files
Output example:
Configuration:
✓ Configuration File: Configuration file is valid
⚠ TypeScript Configuration: Path alias '@/sugarcoat' not configured
→ Run 'npx @sugarcoat/cli sync' to fix paths
Project Structure:
✓ Directory Structure: All required directories exist
✓ Dependencies: All required dependencies are installed
✓ Panda Configuration: Panda CSS is properly configured
Components:
✓ Installed Components: 3 components installed and files present
Summary: 6 checks performed
✓ 5 passed
⚠ 1 warnings
Configuration
The CLI uses a sugarcoat.json file to manage your project configuration:
Configuration Options
| Option | Description | Values |
|---|---|---|
setupType | Installation mode for components |
|
components | Array of installed components | string[] |
paths.alias | TypeScript path alias for imports | @/sugarcoat |
paths.base | Base directory for all Sugarcoat files | ./src/sugarcoat |
TypeScript Integration
The CLI automatically configures TypeScript paths in your tsconfig.json:
This allows you to import components using clean, consistent paths:
Project Structure
After initialization, your project will have this structure:
your-project/
├── sugarcoat.json
├── panda.config.mjs
├── tsconfig.json (updated)
└── src/
└── sugarcoat/
├── design-system/ # Generated by Panda CSS
├── ui/ # Component source code
│ ├── Button/
│ ├── Card/
│ └── ...
├── lib/ # Utility functions
└── types/ # TypeScript definitions
Components are imported from your local source:
Troubleshooting
Common Issues
Setup problems:
- Run
npx @sugarcoat/cli setup --resetto start fresh - Use
npx @sugarcoat/cli doctorto diagnose issues - Check that you have a valid
package.jsonin your project
Import errors after adding components:
- Run
npx @sugarcoat/cli setupto reconfigure paths - Ensure TypeScript paths are configured correctly
- Restart your TypeScript language server
- Check that
sugarcoat.jsonpaths match your project structure
Panda CSS not generating files (Custom mode):
- Verify
panda.config.mjsexists and is valid - Run
npx @sugarcoat/cli generate allmanually - Check that
@pandacss/devis installed
Component styles not applying:
- Ensure CSS files are imported in your app
- Check that Panda CSS generation completed successfully
- Verify component recipes are included in your config
Getting Help
Migration
From PnP to Custom
- Run
npx @sugarcoat/cli init customin your project - Choose your theme colors
- Re-add your components:
npx @sugarcoat/cli add [component-list] - Update your imports to use the new paths
- Remove the old
@sugarcoat/design-systemdependency
From Custom to PnP
- Run
npx @sugarcoat/cli init pnpin your project - Remove local component files from
src/sugarcoat - Update your imports to use
@sugarcoat/design-system - Remove Panda CSS configuration files
Examples
Quick Start (Recommended)
Framework-Specific Setup
Basic Setup (Legacy)
Advanced Customization (Custom Mode)
The Sugarcoat CLI makes it easy to get started with our design system while providing the flexibility to customize and extend components as your project grows.