|
19 | 19 | * React |
20 | 20 |
|
21 | 21 | ### Components and Theme |
22 | | -Let's choose a feature-rich component set with easy theming control |
23 | | -* -[ ] [Mantine](https://ui.mantine.dev/) |
24 | | -* -[x] [Shadcn](https://ui.shadcn.com/) |
| 22 | +* -[x] [Mantine](https://ui.mantine.dev/) |
| 23 | +* -[ ] [Shadcn](https://ui.shadcn.com/) |
25 | 24 |
|
26 | | -#### Shadcn Rationale |
| 25 | +#### Mantine Rationale |
27 | 26 |
|
28 | | -Shadcn is recommended based on evaluation of both prototype implementations (`v2/prototype/shadcn` and `v2/prototype/mantine`). |
| 27 | +Mantine is recommended based on evaluation of both prototype implementations (`v2/prototype/shadcn` and `v2/prototype/mantine`) and group discussion. |
29 | 28 |
|
30 | | -**Why Shadcn over Mantine:** |
| 29 | +**Notes from Prototype Comparison:** |
31 | 30 |
|
32 | | -| Requirement | Shadcn | Mantine | |
33 | | -|-------------|--------|---------| |
34 | | -| Component ownership | Yes - Copy to codebase | No - npm dependency | |
35 | | -| Styling approach | Tailwind CSS | CSS-in-JS (emotion) | |
36 | | -| Bundle size | Minimal - Only used components | Larger - Full library | |
37 | | -| Customization | Full control - Edit source directly | Theme config only | |
38 | | -| Dark mode | CSS variables | Context provider | |
| 31 | +Shadcn lacks layout components, requiring extensive Tailwind class management for containers, spacing, and alignment. This adds friction and cognitive load, based on our experiences with the current Inspector. Mantine's layout components (`Flex`, `Stack`, etc.) make the code more concise and easier to understand. |
39 | 32 |
|
40 | | -**Benefits:** |
41 | | - |
42 | | -1. **Component Ownership** - Components are copied into your project, not installed as dependencies. This means: |
43 | | - - More control over implementation details |
44 | | - - Easier to modify for project-specific needs |
45 | | - |
46 | | -2. **Tailwind CSS Integration**: |
47 | | - - Theme customization via CSS variables |
48 | | - - Smaller production bundles (unused styles purged) |
49 | | - |
50 | | -3. **Simpler Theme Architecture** - CSS variables for theming: |
51 | | - - Light/dark mode via CSS class toggle |
52 | | - - Easy to extend with custom color schemes |
53 | | - - Works seamlessly with Tailwind |
| 33 | +Although the code may be less directly customizable, we don't expect extensive theming or branding to be a priority for Inspector as a debugging tool. |
54 | 34 |
|
55 | | -4. **Developer Experience from Prototype**: |
56 | | - - Faster iteration when modifying components |
57 | | - - More readable component code |
58 | | - - Easier debugging (source is in your project) |
| 35 | +See [PR #980 discussion](https://github.com/modelcontextprotocol/inspector/pull/980#issuecomment-3667102518) for example code comparison. |
59 | 36 |
|
60 | | -**Tradeoffs:** |
| 37 | +| Requirement | Mantine | Shadcn | |
| 38 | +|-------------|---------|--------| |
| 39 | +| Layout components | Yes - Flex, Stack, Group, Grid | No - Use Tailwind divs | |
| 40 | +| Out-of-box experience | Yes - Comprehensive | Partial - Assemble yourself | |
| 41 | +| Code verbosity | Concise JSX props | Verbose Tailwind classes | |
| 42 | +| Styling approach | Props + theme config | Tailwind utility classes | |
| 43 | +| Documentation | Extensive API docs | Component examples | |
61 | 44 |
|
62 | | -- **Initial setup** - Requires adding components individually (vs Mantine's single install) |
63 | | -- **Less "batteries included"** - Some advanced features need additional work (e.g., date pickers, rich text) |
64 | | -- **Documentation** - Mantine has more extensive API docs for each prop |
65 | | - |
66 | | -**Prototype Comparison:** |
67 | | - |
68 | | -Both prototypes implement the same V2 UX spec. Key observations: |
| 45 | +**Benefits:** |
69 | 46 |
|
70 | | -| Aspect | Shadcn Prototype | Mantine Prototype | |
71 | | -|--------|------------------|-------------------| |
72 | | -| Code clarity | Component code visible in project | Abstracted in node_modules | |
73 | | -| Theme toggle | CSS class swap | useMantineColorScheme hook | |
74 | | -| Custom styling | Add Tailwind classes directly | Override with sx prop or styles API | |
75 | | -| Component modification | Edit the file | Create wrapper or fork | |
| 47 | +1. **Built-in Layout Components** - Mantine provides layout primitives as JSX components: |
| 48 | + - `Flex`, `Stack`, `Group`, `Grid`, `Center`, `Container` |
| 49 | + - No need to manage `div` elements with Tailwind classes |
| 50 | + - More declarative, readable code |
| 51 | + |
| 52 | +2. **Reduced Class Management** - Compare the same UI element: |
| 53 | + ```tsx |
| 54 | + // Mantine - concise |
| 55 | + <Alert icon={<IconAlertTriangle />} color="yellow" title="Warning"> |
| 56 | + {message} |
| 57 | + </Alert> |
| 58 | + |
| 59 | + // Shadcn + Tailwind - verbose class strings |
| 60 | + <div className="flex items-start gap-3 rounded-lg border border-yellow-200 |
| 61 | + bg-yellow-50 p-4 text-yellow-800 dark:border-yellow-900 dark:bg-yellow-950 |
| 62 | + dark:text-yellow-200"> |
| 63 | + <IconAlertTriangle className="h-5 w-5 flex-shrink-0" /> |
| 64 | + <div className="flex-1"><p className="font-medium">Warning</p>{message}</div> |
| 65 | + </div> |
| 66 | + ``` |
| 67 | + |
| 68 | +3. **Better Out-of-Box Experience**: |
| 69 | + - Single install provides all components |
| 70 | + - Consistent API across all components |
76 | 71 |
|
77 | 72 | ## Proxy Server |
78 | 73 | ### Language and Runtime |
|
0 commit comments