# shopify/polaris-react-archive architecture

> Architecture diagram of the GitHub repository shopify/polaris-react-archive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shopify/polaris-react-archive
- Repository: https://github.com/shopify/polaris-react-archive

## Overview

Polaris is an archived Shopify design-system monorepo: its React package supplies UI components, design tokens define shared visual values, and the documentation site presents the system to users. The tree also shows a VS Code extension, migration tooling, icons, and custom Stylelint rules. A key user workflow is searching the documentation and opening a result; the code excerpt shows search-index loading and result rendering. Connections between other packages are limited to relationships explicit in the README or source index; unsampled implementation details are not inferred.

Main entry points: [`polaris.shopify.com/src/components/GlobalSearch/GlobalSearch.tsx`](https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/components/GlobalSearch/GlobalSearch.tsx) (Global search), [`polaris-react/src/index.ts`](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/index.ts) (React component library), [`polaris-tokens/src/index.ts`](https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/index.ts) (Token exports), [`polaris-tokens/src/themes/base/color.ts`](https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/themes/base/color.ts) (Base color theme)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["React UI"]
  node_react["React component library<br/>[index.ts]"]
  node_toast["Toast notifications<br/>[Toast.tsx]"]
  node_presence["Presence manager"]
  node_portals["Portal manager<br/>[PortalsManager.tsx]"]
  node_sticky["Sticky manager<br/>[sticky-manager.ts]"]
  node_details["Component showcase<br/>[DetailsPage.tsx]"]
end

subgraph group_tokens["Design Tokens"]
  node_tokens["Token exports<br/>[index.ts]"]
  node_colors["Color tokens<br/>[colors.ts]"]
  node_basecolor["Base color theme<br/>[color.ts]"]
end

subgraph group_docs["Documentation Site"]
  node_search["Global search<br/>[GlobalSearch.tsx]"]
  node_searchutil["Search utilities<br/>[search.ts]"]
  node_page["Page layout<br/>[Page.tsx]"]
  node_componentpage["Component reference route<br/>[index.tsx]"]
end

subgraph group_tools["Developer Tools"]
  node_vscode["VS Code extension<br/>[client.ts]"]
  node_vscodeserver["Extension server<br/>[server.ts]"]
  node_migrator["Migration CLI<br/>[cli.ts]"]
  node_migrate["Migration engine<br/>[migrate.ts]"]
  node_stylelint["Polaris Stylelint rules<br/>[index.js]"]
end

subgraph group_assets["Icon Assets"]
  node_icons["Icon package<br/>[icon-template.js]"]
end

node_reader(("App developer"))
node_siteuser(("Documentation visitor"))

node_reader -->|"uses components"| node_react
node_siteuser -.->|"searches docs"| node_search
node_search -->|"uses search helpers"| node_searchutil
node_search -.->|"shows results"| node_siteuser
node_siteuser -.->|"opens reference"| node_componentpage
node_componentpage -.->|"renders layout"| node_page
node_react -.->|"uses design tokens"| node_tokens
node_tokens -->|"exports color theme"| node_basecolor
node_basecolor -->|"imports palette"| node_colors
node_details -->|"imports components"| node_react
node_vscode -.->|"starts server"| node_vscodeserver
node_migrator -.->|"runs migration"| node_migrate
node_stylelint -->|"checks token names"| node_tokens

click node_react "https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/index.ts"
click node_toast "https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/components/Frame/components/Toast/Toast.tsx"
click node_presence "https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/components/EphemeralPresenceManager/EphemeralPresenceManager.tsx"
click node_portals "https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/components/PortalsManager/PortalsManager.tsx"
click node_sticky "https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/utilities/sticky-manager/sticky-manager.ts"
click node_tokens "https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/index.ts"
click node_colors "https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/colors.ts"
click node_basecolor "https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/themes/base/color.ts"
click node_search "https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/components/GlobalSearch/GlobalSearch.tsx"
click node_searchutil "https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/utils/search.ts"
click node_page "https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/components/Page/Page.tsx"
click node_componentpage "https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/pages/components/%5Bgroup%5D/%5Bcomponent%5D/index.tsx"
click node_details "https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/playground/DetailsPage.tsx"
click node_vscode "https://github.com/shopify/polaris-react-archive/blob/main/polaris-for-vscode/src/client.ts"
click node_vscodeserver "https://github.com/shopify/polaris-react-archive/blob/main/polaris-for-vscode/src/server.ts"
click node_migrator "https://github.com/shopify/polaris-react-archive/blob/main/polaris-migrator/src/cli.ts"
click node_migrate "https://github.com/shopify/polaris-react-archive/blob/main/polaris-migrator/src/migrate.ts"
click node_stylelint "https://github.com/shopify/polaris-react-archive/blob/main/stylelint-polaris/index.js"
click node_icons "https://github.com/shopify/polaris-react-archive/blob/main/polaris-icons/icon-template.js"

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_react,node_toast,node_presence,node_portals,node_sticky,node_details toneBlue
class node_tokens,node_colors,node_basecolor toneAmber
class node_search,node_searchutil,node_page,node_componentpage toneMint
class node_vscode,node_vscodeserver,node_migrator,node_migrate,node_stylelint toneRose
class node_icons,node_reader,node_siteuser toneIndigo
```

## Components

### React UI

- [React component library](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/index.ts): `polaris-react/src/index.ts`
- [Toast notifications](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/components/Frame/components/Toast/Toast.tsx): `polaris-react/src/components/Frame/components/Toast/Toast.tsx`
- [Presence manager](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/components/EphemeralPresenceManager/EphemeralPresenceManager.tsx): `polaris-react/src/components/EphemeralPresenceManager/EphemeralPresenceManager.tsx`
- [Portal manager](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/components/PortalsManager/PortalsManager.tsx): `polaris-react/src/components/PortalsManager/PortalsManager.tsx`
- [Sticky manager](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/src/utilities/sticky-manager/sticky-manager.ts): `polaris-react/src/utilities/sticky-manager/sticky-manager.ts`
- [Component showcase](https://github.com/shopify/polaris-react-archive/blob/main/polaris-react/playground/DetailsPage.tsx): `polaris-react/playground/DetailsPage.tsx`

### Design Tokens

- [Token exports](https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/index.ts): `polaris-tokens/src/index.ts`
- [Color tokens](https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/colors.ts): `polaris-tokens/src/colors.ts`
- [Base color theme](https://github.com/shopify/polaris-react-archive/blob/main/polaris-tokens/src/themes/base/color.ts): `polaris-tokens/src/themes/base/color.ts`

### Documentation Site

- [Global search](https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/components/GlobalSearch/GlobalSearch.tsx): `polaris.shopify.com/src/components/GlobalSearch/GlobalSearch.tsx`
- [Search utilities](https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/utils/search.ts): `polaris.shopify.com/src/utils/search.ts`
- [Page layout](https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/src/components/Page/Page.tsx): `polaris.shopify.com/src/components/Page/Page.tsx`
- [Component reference route](https://github.com/shopify/polaris-react-archive/blob/main/polaris.shopify.com/pages/components/%5Bgroup%5D/%5Bcomponent%5D/index.tsx): `polaris.shopify.com/pages/components/[group]/[component]/index.tsx`

### Developer Tools

- [VS Code extension](https://github.com/shopify/polaris-react-archive/blob/main/polaris-for-vscode/src/client.ts): `polaris-for-vscode/src/client.ts`
- [Extension server](https://github.com/shopify/polaris-react-archive/blob/main/polaris-for-vscode/src/server.ts): `polaris-for-vscode/src/server.ts`
- [Migration CLI](https://github.com/shopify/polaris-react-archive/blob/main/polaris-migrator/src/cli.ts): `polaris-migrator/src/cli.ts`
- [Migration engine](https://github.com/shopify/polaris-react-archive/blob/main/polaris-migrator/src/migrate.ts): `polaris-migrator/src/migrate.ts`
- [Polaris Stylelint rules](https://github.com/shopify/polaris-react-archive/blob/main/stylelint-polaris/index.js): `stylelint-polaris/index.js`

### Icon Assets

- [Icon package](https://github.com/shopify/polaris-react-archive/blob/main/polaris-icons/icon-template.js): `polaris-icons/icon-template.js`

### Other components

- **App developer**
- **Documentation visitor**

## Connections

- App developer → React component library: uses components
- Documentation visitor → Global search: searches docs
- Global search → Search utilities: uses search helpers (evidence: `polaris.shopify.com/src/components/GlobalSearch/GlobalSearch.tsx`)
- Global search → Documentation visitor: shows results
- Documentation visitor → Component reference route: opens reference
- Component reference route → Page layout: renders layout
- React component library → Token exports: uses design tokens
- Token exports → Base color theme: exports color theme (evidence: `polaris-tokens/src/index.ts`)
- Base color theme → Color tokens: imports palette (evidence: `polaris-tokens/src/themes/base/color.ts`)
- Component showcase → React component library: imports components (evidence: `polaris-react/playground/DetailsPage.tsx`)
- VS Code extension → Extension server: starts server
- Migration CLI → Migration engine: runs migration
- Polaris Stylelint rules → Token exports: checks token names (evidence: `stylelint-polaris/index.js`)
