Available Components
WorkspaceWrapper
A standardized component for handling workspace ID resolution and validation across the application. The canonical implementation is shared frompackages/ui at
packages/ui/src/components/ui/custom/workspace-wrapper.tsx and is imported as
@tuturuuu/ui/custom/workspace-wrapper. apps/web/src/components/workspace-wrapper.tsx
is a thin re-export kept for backward compatibility with existing imports.
- WorkspaceWrapper Guide - Complete documentation with examples
- Quick Reference - Quick reference guide
Component Guidelines
When to Create a Component
Create a new component when:- Reusability: The code is used in 2+ places
- Complexity: The logic is complex enough to warrant separation
- Testing: The component needs isolated testing
- Maintenance: The component has specific maintenance requirements
Where Components Live
Components belong in the narrowest home that fits their reuse:- Shared / reusable components (used across apps) live in
packages/uiunderpackages/ui/src/components/ui/custom/. For example,WorkspaceWrapperlives atpackages/ui/src/components/ui/custom/workspace-wrapper.tsxand is imported via@tuturuuu/ui/custom/workspace-wrapper. - App-specific components live in that app’s
components/directory (for exampleapps/web/src/components/). - When a shared component is promoted to
packages/ui, keep the old app path stable with a thin re-export so existing imports keep working — asapps/web/src/components/workspace-wrapper.tsxdoes forWorkspaceWrapper.
__tests__/ directories next to the code.
Documentation Requirements
Each component must include:- Purpose: What the component does
- Props: Complete API reference
- Examples: Real-world usage examples
- Migration Guide: If replacing existing patterns
- Best Practices: Usage guidelines
Naming Conventions
- Components: PascalCase (
WorkspaceWrapper) - Files: kebab-case (
workspace-wrapper.mdx) - Props: camelCase (
params) - Types: PascalCase with descriptive suffixes (
WorkspaceWrapperProps)
Contributing
When adding new components:- Create the component in the narrowest home that fits its reuse —
packages/uifor shared/reusable components, or the app’scomponents/directory for app-specific ones - Add comprehensive documentation
- Include TypeScript types
- Add tests
- Update this overview page
- Follow the established patterns