# mahmoud-nb/vue3-rating-input architecture

> Architecture diagram of the GitHub repository mahmoud-nb/vue3-rating-input, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahmoud-nb/vue3-rating-input
- Repository: https://github.com/mahmoud-nb/vue3-rating-input

## Overview

This is a Vue 3 star-rating input library. A host application imports or registers the component, supplies its value and options, and receives rating updates through v-model / update:modelValue. The component handles pointer and keyboard interaction, delegates pointer-position tracking, and renders each star through an SVG child. Accessibility modes, configurable appearance, half-star selection, and slots are capabilities of the component rather than separate subsystems. The graph is based on the README and sampled source; the example app is shown separately from the package entry point.

Main entry points: [`src/components/rating-input.vue`](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/components/rating-input.vue) (Rating Input), [`src/components/StarSVG.vue`](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/components/StarSVG.vue) (Star SVG), [`src/index.ts`](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/index.ts) (Library Entry), [`src/types/globals.ts`](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/types/globals.ts) (Rating Types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Package API"]
  node_api["Library Entry<br/>[index.ts]"]
end

subgraph group_rating["Rating Interaction"]
  node_rating["Rating Input<br/>[rating-input.vue]"]
  node_mouse["Mouse Observer<br/>[observeMouse.ts]"]
end

subgraph group_render["Star Rendering"]
  node_star["Star SVG<br/>[StarSVG.vue]"]
  node_defs["SVG Definitions<br/>[starDefs.ts]"]
end

subgraph group_types["Shared Types"]
  node_types["Rating Types<br/>[globals.ts]"]
end

node_host(("Host Application"))
node_demo["Example App<br/>[App.vue]"]

node_host -->|"imports or registers"| node_api
node_api -->|"exports and registers"| node_rating
node_host -->|"sets value and options"| node_rating
node_rating -->|"emits rating update"| node_host
node_rating -->|"tracks pointer position"| node_mouse
node_rating -->|"renders stars"| node_star
node_star -->|"injects shared symbols"| node_defs
node_rating -->|"uses prop types"| node_types
node_star -->|"uses appearance types"| node_types
node_demo -->|"uses component"| node_rating

click node_api "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/index.ts"
click node_rating "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/components/rating-input.vue"
click node_mouse "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/composables/observeMouse.ts"
click node_star "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/components/StarSVG.vue"
click node_defs "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/composables/starDefs.ts"
click node_types "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/types/globals.ts"
click node_demo "https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/App.vue"

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_api toneBlue
class node_rating,node_mouse toneAmber
class node_star,node_defs toneMint
class node_types toneRose
class node_host toneIndigo
class node_demo toneTeal
```

## Components

### Package API

- [Library Entry](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/index.ts): `src/index.ts`

### Rating Interaction

- [Rating Input](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/components/rating-input.vue): `src/components/rating-input.vue`
- [Mouse Observer](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/composables/observeMouse.ts): `src/composables/observeMouse.ts`

### Star Rendering

- [Star SVG](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/components/StarSVG.vue): `src/components/StarSVG.vue`
- [SVG Definitions](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/composables/starDefs.ts): `src/composables/starDefs.ts`

### Shared Types

- [Rating Types](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/types/globals.ts): `src/types/globals.ts`

### Other components

- **Host Application**
- [Example App](https://github.com/mahmoud-nb/vue3-rating-input/blob/master/src/App.vue): `src/App.vue`

## Connections

- Host Application → Library Entry: imports or registers (evidence: `README.md`)
- Library Entry → Rating Input: exports and registers (evidence: `src/index.ts`)
- Host Application → Rating Input: sets value and options (evidence: `README.md`)
- Rating Input → Host Application: emits rating update (evidence: `src/components/rating-input.vue`)
- Rating Input → Mouse Observer: tracks pointer position (evidence: `src/components/rating-input.vue`)
- Rating Input → Star SVG: renders stars (evidence: `src/components/rating-input.vue`)
- Star SVG → SVG Definitions: injects shared symbols (evidence: `src/components/StarSVG.vue`)
- Rating Input → Rating Types: uses prop types (evidence: `src/components/rating-input.vue`)
- Star SVG → Rating Types: uses appearance types (evidence: `src/components/StarSVG.vue`)
- Example App → Rating Input: uses component (evidence: `src/App.vue`)
