# shadcnstudio/shadcn-studio architecture

> Architecture diagram of the GitHub repository shadcnstudio/shadcn-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shadcnstudio/shadcn-studio
- Repository: https://github.com/shadcnstudio/shadcn-studio

## Overview

shadcn/studio is a Next.js showcase and customization site for copy-and-paste UI components, blocks, templates, and themes. The main visitor journey is to browse component or block examples, inspect and copy implementation code, or open the theme generator to preview and adjust styles. The repository also contains dashboard and marketing block previews. The graph covers the documented product branches and source-indexed core modules; unsampled routes and dynamic wiring are represented only where the tree or README supports them.

Main entry points: [`src/contexts/settingsContext.tsx`](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/contexts/settingsContext.tsx) (Theme settings), [`src/utils/shadows.ts`](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/shadows.ts) (Shadow styles), [`src/providers/ThemesProvider.tsx`](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/providers/ThemesProvider.tsx) (Theme application), [`src/utils/theme-style-generator.ts`](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/theme-style-generator.ts) (Style generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Discovery and catalog"]
  node_component_catalog["Component catalog<br/>[page.tsx]"]
  node_component_config["Component registry<br/>[components.tsx]"]
  node_blocks_catalog["Blocks catalog"]
  node_blocks_index_route["Blocks route<br/>[page.tsx]"]
  node_block_details["Block details<br/>[BlockPage.tsx]"]
  node_component_details["Component details"]
  node_code_views["Code views"]
  node_source_endpoint["Source endpoint<br/>[route.ts]"]
end

subgraph group_examples["UI examples"]
  node_component_variants["Component variants"]
  node_marketing_blocks["Marketing blocks"]
  node_dashboard_blocks["Dashboard blocks"]
  node_dashboard_preview["Dashboard preview<br/>[page.tsx]"]
end

subgraph group_theme["Theme customization"]
  node_theme_page["Theme generator<br/>[page.tsx]"]
  node_theme_controls["Theme controls"]
  node_theme_settings["Theme settings"]
  node_theme_storage[("Theme persistence<br/>[useLocalStorage.ts]")]
  node_theme_presets["Theme presets<br/>[theme-presets.ts]"]
  node_theme_provider["Theme application<br/>[ThemesProvider.tsx]"]
  node_style_generator["Style generation"]
  node_color_conversion["Color conversion<br/>[color-converter.ts]"]
  node_shadow_styles["Shadow styles<br/>[shadows.ts]"]
  node_theme_types["Theme model<br/>[theme.ts]"]
  node_theme_config["Default theme<br/>[theme.ts]"]
end

subgraph group_foundation["Shared UI foundation"]
  node_ui_button["Button primitive<br/>[button.tsx]"]
  node_ui_card["Card primitive<br/>[card.tsx]"]
  node_ui_avatar["Avatar primitive<br/>[avatar.tsx]"]
  node_ui_breadcrumb["Breadcrumb primitive<br/>[breadcrumb.tsx]"]
  node_ui_dropdown["Dropdown primitive<br/>[dropdown-menu.tsx]"]
  node_ui_separator["Separator primitive<br/>[separator.tsx]"]
  node_ui_sheet["Sheet primitive<br/>[sheet.tsx]"]
  node_ui_sidebar["Sidebar primitive<br/>[sidebar.tsx]"]
end

node_visitor(("Site visitor"))

node_visitor -->|"browses"| node_component_catalog
node_visitor -->|"browses"| node_blocks_index_route
node_blocks_index_route -->|"renders"| node_blocks_catalog
node_component_catalog -->|"uses registry"| node_component_config
node_blocks_catalog -.->|"opens examples"| node_block_details
node_visitor -->|"inspects examples"| node_component_details
node_component_details -.->|"shows code"| node_code_views
node_code_views -.->|"loads source"| node_source_endpoint
node_visitor -->|"copies variants"| node_component_variants
node_visitor -->|"previews dashboard"| node_dashboard_preview
node_dashboard_preview -->|"renders blocks"| node_dashboard_blocks
node_dashboard_preview -->|"uses sidebar"| node_ui_sidebar
node_visitor -->|"customizes theme"| node_theme_page
node_theme_page -.->|"presents controls"| node_theme_controls
node_theme_controls -->|"updates settings"| node_theme_settings
node_theme_settings -->|"persists theme"| node_theme_storage
node_theme_settings -->|"applies preset"| node_theme_presets
node_theme_provider -->|"reads settings"| node_theme_settings
node_theme_provider -->|"converts colors"| node_color_conversion
node_theme_provider -->|"builds shadows"| node_shadow_styles
node_theme_presets -->|"uses defaults"| node_theme_config
node_theme_presets -->|"returns theme data"| node_theme_types
node_theme_config -->|"defines theme"| node_theme_types
node_style_generator -->|"converts colors"| node_color_conversion
node_style_generator -->|"formats shadows"| node_shadow_styles
node_style_generator -->|"uses defaults"| node_theme_config
node_shadow_styles -->|"converts colors"| node_color_conversion
node_shadow_styles -->|"uses theme model"| node_theme_types
node_ui_sidebar -->|"uses sheet"| node_ui_sheet
node_ui_sidebar -->|"uses separator"| node_ui_separator

click node_component_catalog "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/components/page.tsx"
click node_component_config "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/config/components.tsx"
click node_blocks_catalog "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/blocks/BlocksIndexContent.tsx"
click node_blocks_index_route "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/blocks/page.tsx"
click node_block_details "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/(blocks-inner-pages)/blocks/%5Bcategory%5D/%5Bsection%5D/BlockPage.tsx"
click node_component_details "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ComponentDetails.tsx"
click node_code_views "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/CodeBlockMultipleView.tsx"
click node_source_endpoint "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/api/get-file-content/route.ts"
click node_component_variants "https://github.com/shadcnstudio/shadcn-studio/tree/main/src/components/shadcn-studio"
click node_marketing_blocks "https://github.com/shadcnstudio/shadcn-studio/tree/main/src/components/shadcn-studio/blocks"
click node_dashboard_blocks "https://github.com/shadcnstudio/shadcn-studio/tree/main/src/components/shadcn-studio/blocks"
click node_dashboard_preview "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(blank)/preview/dashboard-and-application/dashboard-shell/dashboard-shell-01/page.tsx"
click node_theme_page "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/theme-generator/page.tsx"
click node_theme_controls "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/customizer/ThemeControlPanel.tsx"
click node_theme_settings "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/contexts/settingsContext.tsx"
click node_theme_storage "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/hooks/useLocalStorage.ts"
click node_theme_presets "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/theme-presets.ts"
click node_theme_provider "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/providers/ThemesProvider.tsx"
click node_style_generator "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/theme-style-generator.ts"
click node_color_conversion "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/color-converter.ts"
click node_shadow_styles "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/shadows.ts"
click node_theme_types "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/types/theme.ts"
click node_theme_config "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/config/theme.ts"
click node_ui_button "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/button.tsx"
click node_ui_card "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/card.tsx"
click node_ui_avatar "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/avatar.tsx"
click node_ui_breadcrumb "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/breadcrumb.tsx"
click node_ui_dropdown "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/dropdown-menu.tsx"
click node_ui_separator "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/separator.tsx"
click node_ui_sheet "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/sheet.tsx"
click node_ui_sidebar "https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/sidebar.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_component_catalog,node_component_config,node_blocks_catalog,node_blocks_index_route,node_block_details,node_component_details,node_code_views,node_source_endpoint toneBlue
class node_component_variants,node_marketing_blocks,node_dashboard_blocks,node_dashboard_preview toneAmber
class node_theme_page,node_theme_controls,node_theme_settings,node_theme_storage,node_theme_presets,node_theme_provider,node_style_generator,node_color_conversion,node_shadow_styles,node_theme_types,node_theme_config toneMint
class node_ui_button,node_ui_card,node_ui_avatar,node_ui_breadcrumb,node_ui_dropdown,node_ui_separator,node_ui_sheet,node_ui_sidebar toneRose
class node_visitor toneIndigo
```

## Components

### Discovery and catalog

- [Component catalog](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/components/page.tsx): `src/app/(front)/components/page.tsx`
- [Component registry](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/config/components.tsx): `src/config/components.tsx`
- [Blocks catalog](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/blocks/BlocksIndexContent.tsx): `src/app/(front)/blocks/BlocksIndexContent.tsx`
- [Blocks route](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/blocks/page.tsx): `src/app/(front)/blocks/page.tsx`
- [Block details](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/(blocks-inner-pages)/blocks/%5Bcategory%5D/%5Bsection%5D/BlockPage.tsx): `src/app/(front)/(blocks-inner-pages)/blocks/[category]/[section]/BlockPage.tsx`
- [Component details](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ComponentDetails.tsx): `src/components/ComponentDetails.tsx`
- [Code views](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/CodeBlockMultipleView.tsx): `src/components/CodeBlockMultipleView.tsx`
- [Source endpoint](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/api/get-file-content/route.ts): `src/app/api/get-file-content/route.ts`

### UI examples

- [Component variants](https://github.com/shadcnstudio/shadcn-studio/tree/main/src/components/shadcn-studio): `src/components/shadcn-studio`
- [Marketing blocks](https://github.com/shadcnstudio/shadcn-studio/tree/main/src/components/shadcn-studio/blocks): `src/components/shadcn-studio/blocks`
- [Dashboard blocks](https://github.com/shadcnstudio/shadcn-studio/tree/main/src/components/shadcn-studio/blocks): `src/components/shadcn-studio/blocks`
- [Dashboard preview](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(blank)/preview/dashboard-and-application/dashboard-shell/dashboard-shell-01/page.tsx): `src/app/(blank)/preview/dashboard-and-application/dashboard-shell/dashboard-shell-01/page.tsx`

### Theme customization

- [Theme generator](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/app/(front)/theme-generator/page.tsx): `src/app/(front)/theme-generator/page.tsx`
- [Theme controls](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/customizer/ThemeControlPanel.tsx): `src/components/customizer/ThemeControlPanel.tsx`
- [Theme settings](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/contexts/settingsContext.tsx): `src/contexts/settingsContext.tsx`
- [Theme persistence](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/hooks/useLocalStorage.ts): `src/hooks/useLocalStorage.ts`
- [Theme presets](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/theme-presets.ts): `src/utils/theme-presets.ts`
- [Theme application](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/providers/ThemesProvider.tsx): `src/providers/ThemesProvider.tsx`
- [Style generation](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/theme-style-generator.ts): `src/utils/theme-style-generator.ts`
- [Color conversion](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/color-converter.ts): `src/utils/color-converter.ts`
- [Shadow styles](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/utils/shadows.ts): `src/utils/shadows.ts`
- [Theme model](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/types/theme.ts): `src/types/theme.ts`
- [Default theme](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/config/theme.ts): `src/config/theme.ts`

### Shared UI foundation

- [Button primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Card primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/card.tsx): `src/components/ui/card.tsx`
- [Avatar primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/avatar.tsx): `src/components/ui/avatar.tsx`
- [Breadcrumb primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/breadcrumb.tsx): `src/components/ui/breadcrumb.tsx`
- [Dropdown primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/dropdown-menu.tsx): `src/components/ui/dropdown-menu.tsx`
- [Separator primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/separator.tsx): `src/components/ui/separator.tsx`
- [Sheet primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/sheet.tsx): `src/components/ui/sheet.tsx`
- [Sidebar primitive](https://github.com/shadcnstudio/shadcn-studio/blob/main/src/components/ui/sidebar.tsx): `src/components/ui/sidebar.tsx`

### Other components

- **Site visitor**

## Connections

- Site visitor → Component catalog: browses (evidence: `README.md`)
- Site visitor → Blocks route: browses (evidence: `README.md`)
- Blocks route → Blocks catalog: renders (evidence: `src/app/(front)/blocks/page.tsx`)
- Component catalog → Component registry: uses registry (evidence: `src/app/(front)/components/page.tsx`)
- Blocks catalog → Block details: opens examples
- Site visitor → Component details: inspects examples (evidence: `README.md`)
- Component details → Code views: shows code
- Code views → Source endpoint: loads source
- Site visitor → Component variants: copies variants (evidence: `README.md`)
- Site visitor → Dashboard preview: previews dashboard (evidence: `README.md`)
- Dashboard preview → Dashboard blocks: renders blocks (evidence: `src/app/(blank)/preview/dashboard-and-application/dashboard-shell/dashboard-shell-01/page.tsx`)
- Dashboard preview → Sidebar primitive: uses sidebar (evidence: `src/app/(blank)/preview/dashboard-and-application/dashboard-shell/dashboard-shell-01/page.tsx`)
- Site visitor → Theme generator: customizes theme (evidence: `README.md`)
- Theme generator → Theme controls: presents controls
- Theme controls → Theme settings: updates settings (evidence: `src/components/customizer/ThemeControlPanel.tsx`)
- Theme settings → Theme persistence: persists theme (evidence: `src/contexts/settingsContext.tsx`)
- Theme settings → Theme presets: applies preset (evidence: `src/contexts/settingsContext.tsx`)
- Theme application → Theme settings: reads settings (evidence: `src/providers/ThemesProvider.tsx`)
- Theme application → Color conversion: converts colors (evidence: `src/providers/ThemesProvider.tsx`)
- Theme application → Shadow styles: builds shadows (evidence: `src/providers/ThemesProvider.tsx`)
- Theme presets → Default theme: uses defaults (evidence: `src/utils/theme-presets.ts`)
- Theme presets → Theme model: returns theme data (evidence: `src/utils/theme-presets.ts`)
- Default theme → Theme model: defines theme (evidence: `src/config/theme.ts`)
- Style generation → Color conversion: converts colors (evidence: `src/utils/theme-style-generator.ts`)
- Style generation → Shadow styles: formats shadows (evidence: `src/utils/theme-style-generator.ts`)
- Style generation → Default theme: uses defaults (evidence: `src/utils/theme-style-generator.ts`)
- Shadow styles → Color conversion: converts colors (evidence: `src/utils/shadows.ts`)
- Shadow styles → Theme model: uses theme model (evidence: `src/utils/shadows.ts`)
- Sidebar primitive → Sheet primitive: uses sheet (evidence: `src/components/ui/sidebar.tsx`)
- Sidebar primitive → Separator primitive: uses separator (evidence: `src/components/ui/sidebar.tsx`)
