# jagthedrummer/polaris_view_helpers architecture

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

- Interactive diagram: https://gitdiagram.com/jagthedrummer/polaris_view_helpers
- Repository: https://github.com/jagthedrummer/polaris_view_helpers

## Overview

PolarisViewHelpers is a Rails view-helper gem for composing Shopify Polaris-styled interfaces. A Rails application includes the gem’s helper module; view code calls its methods, which render Polaris partials for page structure, forms, navigation, and content components. The helper also supplies a versioned Polaris stylesheet link and can read SVG icons. The excerpts show helper-to-partial rendering and gem registration, but not application call sites; the initiating view-to-helper link is therefore unverified.

Main entry points: [`lib/polaris_view_helpers/helper.rb`](https://github.com/jagthedrummer/polaris_view_helpers/blob/master/lib/polaris_view_helpers/helper.rb) (View helpers), [`lib/polaris_view_helpers.rb`](https://github.com/jagthedrummer/polaris_view_helpers/blob/master/lib/polaris_view_helpers.rb) (Gem entry), [`app/views/polaris`](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris) (Pages and layouts), [`app/views/polaris/icons`](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris/icons) (SVG icons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Rails integration"]
  node_gem_entry["Gem entry"]
  node_helper["View helpers<br/>[helper.rb]"]
end

subgraph group_structure["Page structure"]
  node_page_layout["Pages and layouts"]
  node_navigation["Tabs and actions"]
end

subgraph group_forms["Forms and errors"]
  node_form_fields["Fields and selects"]
  node_form_errors["Form errors"]
end

subgraph group_components["UI components"]
  node_content["Content elements"]
  node_icons["SVG icons"]
end

node_rails_app(("Rails view"))
node_polaris_cdn["Polaris stylesheet"]

node_rails_app -.->|"uses helpers"| node_gem_entry
node_gem_entry -->|"includes module"| node_helper
node_helper -->|"renders"| node_page_layout
node_helper -->|"renders"| node_navigation
node_helper -->|"renders"| node_form_fields
node_helper -->|"renders"| node_form_errors
node_helper -->|"renders"| node_content
node_helper -->|"reads SVG"| node_icons
node_helper -->|"links stylesheet"| node_polaris_cdn

click node_gem_entry "https://github.com/jagthedrummer/polaris_view_helpers/blob/master/lib/polaris_view_helpers.rb"
click node_helper "https://github.com/jagthedrummer/polaris_view_helpers/blob/master/lib/polaris_view_helpers/helper.rb"
click node_page_layout "https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris"
click node_navigation "https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris"
click node_form_fields "https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris"
click node_form_errors "https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris"
click node_content "https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris"
click node_icons "https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris/icons"

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_gem_entry,node_helper,node_rails_app toneBlue
class node_page_layout,node_navigation toneAmber
class node_form_fields,node_form_errors toneMint
class node_content,node_icons toneRose
class node_polaris_cdn toneIndigo
```

## Components

### Rails integration

- [Gem entry](https://github.com/jagthedrummer/polaris_view_helpers/blob/master/lib/polaris_view_helpers.rb): `lib/polaris_view_helpers.rb`
- [View helpers](https://github.com/jagthedrummer/polaris_view_helpers/blob/master/lib/polaris_view_helpers/helper.rb): `lib/polaris_view_helpers/helper.rb`

### Page structure

- [Pages and layouts](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris): `app/views/polaris`
- [Tabs and actions](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris): `app/views/polaris`

### Forms and errors

- [Fields and selects](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris): `app/views/polaris`
- [Form errors](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris): `app/views/polaris`

### UI components

- [Content elements](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris): `app/views/polaris`
- [SVG icons](https://github.com/jagthedrummer/polaris_view_helpers/tree/master/app/views/polaris/icons): `app/views/polaris/icons`

### Other components

- **Rails view**
- **Polaris stylesheet**

## Connections

- Rails view → Gem entry: uses helpers
- Gem entry → View helpers: includes module (evidence: `lib/polaris_view_helpers.rb`)
- View helpers → Pages and layouts: renders (evidence: `lib/polaris_view_helpers/helper.rb`)
- View helpers → Tabs and actions: renders (evidence: `lib/polaris_view_helpers/helper.rb`)
- View helpers → Fields and selects: renders (evidence: `lib/polaris_view_helpers/helper.rb`)
- View helpers → Form errors: renders (evidence: `lib/polaris_view_helpers/helper.rb`)
- View helpers → Content elements: renders (evidence: `lib/polaris_view_helpers/helper.rb`)
- View helpers → SVG icons: reads SVG (evidence: `lib/polaris_view_helpers/helper.rb`)
- View helpers → Polaris stylesheet: links stylesheet (evidence: `lib/polaris_view_helpers/helper.rb`)
