Skip to main content
This guide covers creating and managing custom UI components in DeployStack, including extending shadcn/vue components, building new components from scratch, and maintaining consistency across your design system.

Philosophy and Approach

DeployStack follows the shadcn/vue philosophy: components are copied into your codebase and become yours to own and customize. This approach provides several key advantages:
  • Full Control: Direct access to component source code for unlimited customization
  • No Breaking Changes: Updates don’t break your customizations since you own the code
  • AI-Friendly: Open code structure allows AI tools to understand and improve components
  • Design System Integration: Components naturally fit together using shared design tokens

When to Create Custom Components

Create custom components when:
  1. Missing Components: The component doesn’t exist in shadcn/vue
  2. Complex Compositions: Combining multiple shadcn components into reusable patterns
  3. Business Logic: Components specific to DeployStack’s domain (e.g., ServerStatusCard, DeploymentProgress)

Component Structure and Organization

Directory Structure

All custom components follow the same structure as shadcn/vue components in src/components/ui/:

Export Pattern

Always follow the shadcn/vue export pattern:

Component Development Guidelines

1. Design Token Integration

✅ Use shadcn/vue design tokens for consistency:
❌ Avoid hard-coded colors:

2. Prop Interface Standards

Follow consistent prop patterns across all components:

3. Class Variance Authority (CVA)

Use CVA for complex styling variants:

4. Accessibility Requirements

Ensure all custom components meet accessibility standards:

Component Types and Examples

1. Composite Components

Components that combine multiple shadcn components:

2. Utility Components

Reusable patterns with business logic:

3. Form Components

Specialized form inputs that extend basic components:

Customizing Existing shadcn Components

Replacing Components

To customize an existing shadcn component, simply modify the files in src/components/ui/[component-name]/:

Documentation Standards

Component Documentation

Each custom component should include comprehensive documentation:

README Documentation

Create a README.md for complex component groups:

API Reference

ButtonGroup Props

Maintenance and Updates

Migration Strategy

When shadcn/vue adds a component you’ve built custom:
  1. Evaluate: Compare features and API design
  2. Migrate: If shadcn version is better, plan migration
  3. Extend: If your version has unique features, consider contributing back
  4. Document: Update migration guides for the team

Version Control

  • Tag component versions in commit messages: feat(ui): add ButtonGroup component v1.0
  • Document breaking changes in component README
  • Maintain changelog for significant UI component updates

For questions about custom components, refer to the UI Design System documentation or reach out to the frontend team.