UI Component Library
Relevant source files
The following files were used as context for generating this wiki page:- README.md
- apps/web/core/components/README.md
- packages/ui/package.json
- apps/web/core/components/features/projects/add-or-edit-project/steps/basic-information-form.tsx
- apps/web/core/components/pages/settings/team/integration-setting.tsx
- apps/web/core/components/layouts/default-layout/main-layout.tsx
- apps/web/core/components/common/skeleton/app-urls-dashboard-page-skeleton.tsx
The Ever Teams platform utilizes a structured, multi-layered approach to its UI components, separating presentation from business logic. The core of this system is the @ever-teams/ui package, which provides a set of shared, "dumb" UI primitives. These are then consumed and composed into "smart," stateful components within the apps/web/core/components directory. This architecture promotes reusability, maintainability, and a consistent look and feel across the web, mobile, and extension applications.
The technology stack for the UI is built upon modern, widely-adopted libraries. It primarily uses React, with styling managed by Tailwind CSS. The component primitives are sourced from established libraries like shadcn/ui, Radix UI, and HeadlessUI, ensuring accessibility and robustness. This layered approach allows developers to quickly build complex features by composing simple, well-defined UI blocks.
Sources: README.md:38-44, apps/web/core/components/README.md:3-4, apps/web/core/components/README.md:88-91
Architecture and Philosophy
The UI architecture is intentionally split into two distinct layers to enforce a separation of concerns. This design distinguishes between pure UI elements and components that contain business logic.
This diagram illustrates the separation between the smart components in the web app and the dumb UI primitives in the shared UI package.
Sources: apps/web/core/components/README.md:88-91
@ever-teams/ui (Dumb Components)
This package, located at packages/ui, contains pure, stateless UI primitives. These components are designed to be highly reusable and are not aware of any specific business logic or application state.
- Purpose: To provide a consistent set of basic building blocks like buttons, inputs, and cards.
- Characteristics:
- Stateless and presentational.
- Receive data and callbacks via props.
- Shared across different applications (web, mobile, extensions).
- Example: A generic
Buttoncomponent that acceptsonClickandchildrenprops.
Sources: apps/web/core/components/README.md:88-91, packages/ui/package.json:2
apps/web/core/components (Smart Components)
This directory within the apps/web application contains "smart" components. These components consume the primitives from @ever-teams/ui and enrich them with application-specific logic, state management, and data fetching.
- Purpose: To build functional features and page layouts.
- Characteristics:
- Stateful and aware of business context.
- Often use hooks for state management (e.g., Jotai) and data fetching.
- Composed of one or more "dumb" components.
- Example: An
IntegrationSettingcomponent that usesButtonandSelectprimitives but also contains logic to fetch, display, and update GitHub integration settings.
Sources: apps/web/core/components/README.md:3-4, apps/web/core/components/pages/settings/team/integration-setting.tsx
Core Technologies
The UI library is built on a foundation of modern frontend technologies to ensure a high-quality developer and user experience.
| Technology | Role | Source |
|---|---|---|
| React | The core library for building the user interface. | packages/ui/package.json:34 |
| Tailwind CSS | A utility-first CSS framework for styling components. | README.md:43 |
| shadcn/ui | A collection of re-usable components built using Radix UI and Tailwind CSS. | README.md:44 |
| Radix UI | Provides unstyled, accessible, low-level UI primitives. | README.md:44, packages/ui/package.json:51-78 |
| Headless UI | A set of completely unstyled, fully accessible UI components. | README.md:44, packages/ui/package.json:49 |
| Jotai | A primitive and flexible state management library for React. | apps/web/core/stores/README.md:4 |
Key Dependencies in @ever-teams/ui
The packages/ui/package.json file lists numerous dependencies that form the component library. Below is a summary of the most critical ones.
| Category | Package | Description |
|---|---|---|
| UI Primitives | @radix-ui/* | A suite of unstyled, accessible components (e.g., Dialog, Dropdown, Select). |
@headlessui/react | Unstyled, accessible UI components like Switch and Dialog. | |
lucide-react | A library of simply designed icons. | |
| Styling | tailwindcss | Utility-first CSS framework. |
class-variance-authority | Create type-safe component variants with Tailwind CSS. | |
tailwind-merge | Merges Tailwind CSS classes without style conflicts. | |
| Forms | react-hook-form | Performant, flexible, and extensible forms with easy-to-use validation. |
@hookform/resolvers | Resolvers for validation libraries like Zod. | |
zod | TypeScript-first schema declaration and validation library. | |
| Interactivity | @atlaskit/pragmatic-drag-and-drop | Drag and drop functionality. |
cmdk | A fast, accessible, and composable command menu for React. | |
| Date & Time | date-fns | Modern JavaScript date utility library. |
react-day-picker | A flexible date picker component for React. |
Sources: packages/ui/package.json:47-91
Build and Packaging
The @ever-teams/ui package is configured to be consumed by other applications within the monorepo.
Build Process
The build process for the UI package involves two main steps:
- CSS Generation: Tailwind CSS is used to process
src/styles/globals.cssand generate a minifieddist/styles.cssfile. - JavaScript/TypeScript Bundling: Rollup is used to bundle the TypeScript component files into JavaScript modules (ESM and CJS formats) and generate type definitions (
.d.ts).
This process is defined by the build script in packages/ui/package.json.
// packages/ui/package.json:30
"build": "npx @tailwindcss/cli -i src/styles/globals.css -o dist/styles.css --minify && rollup -c",
Package Exports
The package.json defines the entry points for the bundled code and styles, allowing other packages to import them correctly.
// packages/ui/package.json:8-14
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.es.js"
},
"./styles.css": "./dist/styles.css"
},
This configuration allows consumers to import components like import { Button } from '@ever-teams/ui'; and the stylesheet via import '@ever-teams/ui/styles.css';.
Sources: packages/ui/package.json:8-14, 30
Component Structure in apps/web
The apps/web application organizes its "smart" components into a clear, domain-driven folder structure inside apps/web/core/components/. This promotes scalability and makes components easy to locate.
This diagram shows the folder structure for smart components within the web application.
Sources: apps/web/core/components/README.md:10-63
| Folder | Responsibility | Examples |
|---|---|---|
common/ | Contains shared, reusable components used across multiple features. They are not tied to a specific business domain but may have internal logic. | modal-wrapper.tsx, file-upload-block.tsx, app-sidebar-skeleton.tsx |
pages/ | Groups components strictly limited to a specific page or route. They are often focused on layout and composition for that view. | settings/team/integration-setting.tsx |
Feature Folders (projects/, tasks/, etc.) | Corresponds to a specific product feature or entity. Components are related to specific business logic. | projects/add-or-edit-project/steps/basic-information-form.tsx |
layouts/ | Contains main layout structures for the application, such as main-layout.tsx, which orchestrates the header, sidebar, and content areas. | default-layout/main-layout.tsx |
Sources: apps/web/core/components/README.md:10-63, apps/web/core/components/common/skeleton/app-urls-dashboard-page-skeleton.tsx, apps/web/core/components/pages/settings/team/integration-setting.tsx, apps/web/core/components/features/projects/add-or-edit-project/steps/basic-information-form.tsx, apps/web/core/components/layouts/default-layout/main-layout.tsx
Summary
The Ever Teams UI component library is a well-architected system that effectively separates concerns between presentation and logic. By leveraging the @ever-teams/ui package for "dumb" primitives and composing them into "smart," feature-aware components within the application layer, the project achieves high reusability and maintainability. The foundation of React, Tailwind CSS, and Radix UI provides a modern and robust toolkit for building a consistent and scalable user interface.