UI Component Naming Convention
Purpose
Use a clear layer + domain naming strategy for UI code, aligned with the api-domain refactor.
Prefixes
Use prefixes at package/workspace boundaries:
ui-domain-*: domain-facing UI modulesui-shared-*: reusable cross-domain UI modulesui-app-*: app shell, providers, and composition roots
Do not force ui- in internal folder names where everything is already UI.
Internal Naming Rules
- Folders: kebab-case
- React components: PascalCase
- File names: PascalCase for component files,
index.tsfor public barrels - Prefer named exports for components
- One public entrypoint per module via
index.ts - Avoid deep imports across modules; import from the module root
Domain Layout Template
Recommended layout inside each domain UI module:
components/sections/dialogs/fields/tables/hooks/model/utils/index.ts
Symbol Naming
Use domain-prefixed symbol names for exported components to avoid collisions.
Examples:
OrganizationListTableOrganizationHeaderSectionOrganizationCreateDialogTeamMembershipTableAuthRotationHistoryPanel
Shared symbols should use Shared or Ui as the prefix when exported publicly.
Examples:
SharedDataTableSharedTableActionsSharedInfiniteList
Migration Rules
- Migrate one domain at a time.
- Add/update the domain
index.tsfirst. - Switch call sites to root imports.
- Remove old deep imports after call sites are migrated.
- Keep temporary compatibility exports only during transition.
Initial Mapping
Suggested mapping for current src/components areas:
- Domain modules:
- organizations, auth, teams, products, tasks, maintenance, profile, workspace, environments, sponsors, audit, entities, graph, debug, session, permissions, webhooks
- Shared modules:
- common, data, tables, decorators
- App modules:
- layout, providers, container, dashboard
Implemented Core Entrypoints
The following prefixed entrypoints are now available:
src/components/ui-domain-auth/index.tssrc/components/ui-domain-audit/index.tssrc/components/ui-domain-debug/index.tssrc/components/ui-domain-graph/index.tssrc/components/ui-domain-entities/index.tssrc/components/ui-domain-permissions/index.tssrc/components/ui-domain-session/index.tssrc/components/ui-shared-common/index.tssrc/components/ui-core/index.ts
Use these as the preferred import sources for new code.
Example:
import { AuthQuickActions, SharedInfoField } from '@/components/ui-core';
Import Guidance
Preferred:
- import from module root public barrel
Avoid:
- deep imports into
components/,dialogs/,fields/, etc.