# hiaaryan/sileo architecture

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

- Interactive diagram: https://gitdiagram.com/hiaaryan/sileo
- Repository: https://github.com/hiaaryan/sileo

## Overview

Sileo is both a React toast package and its documentation/demo site. In the package workflow, an application invokes the toast API; the toaster manages toast state and placement, then renders animated toast cards. The site demonstrates this flow through interactive examples and provides documentation and styling guidance. Source excerpts establish the main package calls and demo wiring; several site and package subsystems are represented at their documented directory paths because their implementation was not sampled.

Main entry points: [`lib/toast-demos.tsx`](https://github.com/hiaaryan/sileo/blob/main/lib/toast-demos.tsx) (Toast examples), [`packages/sileo/src/toast.tsx`](https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/toast.tsx) (Toast API), [`app/(main)/page.tsx`](https://github.com/hiaaryan/sileo/blob/main/app/(main)/page.tsx) (Home page), [`components/code-preview.tsx`](https://github.com/hiaaryan/sileo/blob/main/components/code-preview.tsx) (Code preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_package["Toast package"]
  node_api["Toast API<br/>[toast.tsx]"]
  node_toaster["Toaster state<br/>[toast.tsx]"]
  node_card["Animated toast<br/>[sileo.tsx]"]
  node_icons["Toast icons<br/>[icons.tsx]"]
  node_constants["Toast defaults<br/>[constants.ts]"]
end

subgraph group_site["Site experience"]
  node_site_layout["Site layout<br/>[layout.tsx]"]
  node_navigation["Navigation<br/>[nav.tsx]"]
  node_theme["Theme context<br/>[theme.tsx]"]
  node_home["Home page<br/>[page.tsx]"]
end

subgraph group_demos["Interactive demos"]
  node_play["Playground page<br/>[page.tsx]"]
  node_demo_helpers["Toast examples<br/>[toast-demos.tsx]"]
  node_preview["Code preview<br/>[code-preview.tsx]"]
  node_buttons["Demo buttons<br/>[button.tsx]"]
  node_wave["Flight animation<br/>[wave.ts]"]
  node_token_colors["Syntax colors<br/>[token-colors.ts]"]
end

subgraph group_docs["Documentation"]
  node_docs["Documentation pages"]
  node_styling["Styling guidance"]
  node_api_docs["API guidance"]
end

node_app(("React application"))

node_app -.->|"invokes"| node_api
node_api -->|"updates store"| node_toaster
node_toaster -->|"renders"| node_card
node_card -->|"uses icons"| node_icons
node_card -->|"uses defaults"| node_constants
node_site_layout -->|"renders"| node_navigation
node_site_layout -->|"uses context"| node_theme
node_home -->|"reads theme"| node_theme
node_home -->|"fires example"| node_demo_helpers
node_home -->|"renders"| node_toaster
node_play -->|"renders"| node_buttons
node_play -->|"fires example"| node_demo_helpers
node_demo_helpers -->|"calls toast API"| node_api
node_demo_helpers -->|"uses geometry"| node_wave
node_preview -->|"calls toast API"| node_api
node_preview -->|"renders"| node_buttons
node_preview -->|"colors tokens"| node_token_colors

click node_api "https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/toast.tsx"
click node_toaster "https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/toast.tsx"
click node_card "https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/sileo.tsx"
click node_icons "https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/icons.tsx"
click node_constants "https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/constants.ts"
click node_site_layout "https://github.com/hiaaryan/sileo/blob/main/app/(main)/layout.tsx"
click node_navigation "https://github.com/hiaaryan/sileo/blob/main/components/nav.tsx"
click node_theme "https://github.com/hiaaryan/sileo/blob/main/app/(main)/theme.tsx"
click node_home "https://github.com/hiaaryan/sileo/blob/main/app/(main)/page.tsx"
click node_play "https://github.com/hiaaryan/sileo/blob/main/app/(main)/play/page.tsx"
click node_demo_helpers "https://github.com/hiaaryan/sileo/blob/main/lib/toast-demos.tsx"
click node_preview "https://github.com/hiaaryan/sileo/blob/main/components/code-preview.tsx"
click node_buttons "https://github.com/hiaaryan/sileo/blob/main/components/button.tsx"
click node_wave "https://github.com/hiaaryan/sileo/blob/main/lib/wave.ts"
click node_token_colors "https://github.com/hiaaryan/sileo/blob/main/lib/token-colors.ts"
click node_docs "https://github.com/hiaaryan/sileo/tree/main/app/(main)/docs"
click node_styling "https://github.com/hiaaryan/sileo/tree/main/app/(main)/docs/styling"
click node_api_docs "https://github.com/hiaaryan/sileo/tree/main/app/(main)/docs/api"

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,node_toaster,node_card,node_icons,node_constants toneBlue
class node_site_layout,node_navigation,node_theme,node_home toneAmber
class node_play,node_demo_helpers,node_preview,node_buttons,node_wave,node_token_colors toneMint
class node_docs,node_styling,node_api_docs toneRose
class node_app toneIndigo
```

## Components

### Toast package

- [Toast API](https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/toast.tsx): `packages/sileo/src/toast.tsx`
- [Toaster state](https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/toast.tsx): `packages/sileo/src/toast.tsx`
- [Animated toast](https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/sileo.tsx): `packages/sileo/src/sileo.tsx`
- [Toast icons](https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/icons.tsx): `packages/sileo/src/icons.tsx`
- [Toast defaults](https://github.com/hiaaryan/sileo/blob/main/packages/sileo/src/constants.ts): `packages/sileo/src/constants.ts`

### Site experience

- [Site layout](https://github.com/hiaaryan/sileo/blob/main/app/(main)/layout.tsx): `app/(main)/layout.tsx`
- [Navigation](https://github.com/hiaaryan/sileo/blob/main/components/nav.tsx): `components/nav.tsx`
- [Theme context](https://github.com/hiaaryan/sileo/blob/main/app/(main)/theme.tsx): `app/(main)/theme.tsx`
- [Home page](https://github.com/hiaaryan/sileo/blob/main/app/(main)/page.tsx): `app/(main)/page.tsx`

### Interactive demos

- [Playground page](https://github.com/hiaaryan/sileo/blob/main/app/(main)/play/page.tsx): `app/(main)/play/page.tsx`
- [Toast examples](https://github.com/hiaaryan/sileo/blob/main/lib/toast-demos.tsx): `lib/toast-demos.tsx`
- [Code preview](https://github.com/hiaaryan/sileo/blob/main/components/code-preview.tsx): `components/code-preview.tsx`
- [Demo buttons](https://github.com/hiaaryan/sileo/blob/main/components/button.tsx): `components/button.tsx`
- [Flight animation](https://github.com/hiaaryan/sileo/blob/main/lib/wave.ts): `lib/wave.ts`
- [Syntax colors](https://github.com/hiaaryan/sileo/blob/main/lib/token-colors.ts): `lib/token-colors.ts`

### Documentation

- [Documentation pages](https://github.com/hiaaryan/sileo/tree/main/app/(main)/docs): `app/(main)/docs`
- [Styling guidance](https://github.com/hiaaryan/sileo/tree/main/app/(main)/docs/styling): `app/(main)/docs/styling`
- [API guidance](https://github.com/hiaaryan/sileo/tree/main/app/(main)/docs/api): `app/(main)/docs/api`

### Other components

- **React application**

## Connections

- React application → Toast API: invokes (evidence: `README.md`)
- Toast API → Toaster state: updates store (evidence: `packages/sileo/src/toast.tsx`)
- Toaster state → Animated toast: renders (evidence: `packages/sileo/src/toast.tsx`)
- Animated toast → Toast icons: uses icons (evidence: `packages/sileo/src/sileo.tsx`)
- Animated toast → Toast defaults: uses defaults (evidence: `packages/sileo/src/sileo.tsx`)
- Site layout → Navigation: renders (evidence: `app/(main)/layout.tsx`)
- Site layout → Theme context: uses context (evidence: `app/(main)/layout.tsx`)
- Home page → Theme context: reads theme (evidence: `app/(main)/page.tsx`)
- Home page → Toast examples: fires example (evidence: `app/(main)/page.tsx`)
- Home page → Toaster state: renders (evidence: `app/(main)/page.tsx`)
- Playground page → Demo buttons: renders (evidence: `app/(main)/play/page.tsx`)
- Playground page → Toast examples: fires example (evidence: `app/(main)/play/page.tsx`)
- Toast examples → Toast API: calls toast API (evidence: `lib/toast-demos.tsx`)
- Toast examples → Flight animation: uses geometry (evidence: `lib/toast-demos.tsx`)
- Code preview → Toast API: calls toast API (evidence: `components/code-preview.tsx`)
- Code preview → Demo buttons: renders (evidence: `components/code-preview.tsx`)
- Code preview → Syntax colors: colors tokens (evidence: `components/code-preview.tsx`)
