# inkonchain/ink-kit architecture

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

- Interactive diagram: https://gitdiagram.com/inkonchain/ink-kit
- Repository: https://github.com/inkonchain/ink-kit

## Overview

Ink Kit is a React UI library for onchain applications. A consuming app imports its public entry point and uses exported controls, layouts, icons, hooks, and the wagmi-based wallet connector to build interfaces. The library also provides themed styling utilities and responsive behavior. The graph preserves documented capabilities and major source-index modules; several component internals and the theme stylesheet are not present in the supplied tree or were not sampled, so their internal connections are left unspecified.

Main entry points: [`src/components/index.ts`](https://github.com/inkonchain/ink-kit/blob/main/src/components/index.ts) (Component exports), [`src/components/Wallet/ConnectWallet.tsx`](https://github.com/inkonchain/ink-kit/blob/main/src/components/Wallet/ConnectWallet.tsx) (Connect wallet), [`src/components/SegmentedControl/SegmentedControl.tsx`](https://github.com/inkonchain/ink-kit/blob/main/src/components/SegmentedControl/SegmentedControl.tsx) (Segmented control), [`src/components/Button/Button.tsx`](https://github.com/inkonchain/ink-kit/blob/main/src/components/Button/Button.tsx) (Button)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["UI Components"]
  node_controls["UI controls"]
  node_alert["Alert<br/>[Alert.tsx]"]
  node_button["Button<br/>[Button.tsx]"]
  node_card["Card and content"]
  node_form_controls["Form controls"]
  node_input["Input<br/>[Input.tsx]"]
  node_list_item["List item<br/>[ListItem.tsx]"]
  node_listbox["Listbox"]
  node_modal["Modal<br/>[Modal.tsx]"]
  node_modal_state["Modal state<br/>[ModalContext.tsx]"]
  node_popover["Popover"]
  node_segmented["Segmented control"]
  node_slot["Slot composition<br/>[Slot.tsx]"]
  node_other_components["Display components"]
  node_effects["Loading effects"]
end

subgraph group_layouts["Layouts"]
  node_layout["App layout<br/>[InkLayout.tsx]"]
  node_navigation["Navigation links<br/>[InkNavLink.tsx]"]
  node_mobile_navigation["Mobile navigation"]
  node_layout_parts["Layout parts"]
  node_ink_panel["Ink panel<br/>[InkPanel.tsx]"]
end

subgraph group_wallet["Wallet Integration"]
  node_wallet["Connect wallet<br/>[ConnectWallet.tsx]"]
  node_wallet_config["Wagmi configuration<br/>[providers.index.ts]"]
  node_ens_name["ENS name lookup"]
  node_ens_image["ENS image lookup"]
end

subgraph group_shared["Shared Runtime"]
  node_breakpoint["Breakpoint hook"]
  node_window_size["Window size hook<br/>[useWindowSize.ts]"]
  node_classes["Class utilities<br/>[classes.ts]"]
  node_trim["Address formatting<br/>[trim.ts]"]
  node_mocks["Mock account<br/>[mocks.ts]"]
  node_theme_hook["Theme class hook"]
end

subgraph group_public["Public API"]
  node_entry["Package entry<br/>[index.ts]"]
  node_component_exports["Component exports<br/>[index.ts]"]
  node_icons["Icon set<br/>[AllIcons.tsx]"]
end

node_app(("Consuming application"))

node_app -->|"imports"| node_entry
node_entry -->|"re-exports"| node_component_exports
node_component_exports -->|"exports"| node_alert
node_component_exports -->|"exports"| node_button
node_component_exports -->|"exports"| node_card
node_component_exports -->|"exports"| node_form_controls
node_component_exports -->|"exports"| node_input
node_component_exports -->|"exports"| node_list_item
node_component_exports -->|"exports"| node_listbox
node_component_exports -->|"exports"| node_modal
node_component_exports -->|"exports"| node_popover
node_component_exports -->|"exports"| node_segmented
node_component_exports -->|"exports"| node_other_components
node_button -->|"uses classes"| node_classes
node_button -->|"composes with"| node_slot
node_segmented -->|"uses classes"| node_classes
node_segmented -->|"uses slot"| node_slot
node_segmented -->|"reads dimensions"| node_window_size
node_modal_state -.->|"provides state"| node_modal
node_mobile_navigation -->|"renders links"| node_navigation
node_navigation -->|"uses classes"| node_classes
node_navigation -->|"uses slot"| node_slot
node_ink_panel -->|"uses classes"| node_classes
node_layout -.->|"uses navigation"| node_navigation
node_layout -.->|"uses parts"| node_layout_parts
node_wallet -->|"renders button"| node_button
node_wallet -->|"renders popover"| node_popover
node_wallet -->|"uses icons"| node_icons
node_wallet -->|"looks up name"| node_ens_name
node_wallet -->|"looks up image"| node_ens_image
node_wallet -->|"checks width"| node_breakpoint
node_wallet -->|"renders placeholder"| node_effects
node_wallet -->|"formats address"| node_trim
node_ens_name -->|"formats fallback"| node_trim
node_ens_name -->|"checks mock account"| node_mocks
node_breakpoint -->|"reads dimensions"| node_window_size

click node_entry "https://github.com/inkonchain/ink-kit/blob/main/src/index.ts"
click node_component_exports "https://github.com/inkonchain/ink-kit/blob/main/src/components/index.ts"
click node_controls "https://github.com/inkonchain/ink-kit/tree/main/src/components"
click node_alert "https://github.com/inkonchain/ink-kit/blob/main/src/components/Alert/Alert.tsx"
click node_button "https://github.com/inkonchain/ink-kit/blob/main/src/components/Button/Button.tsx"
click node_card "https://github.com/inkonchain/ink-kit/tree/main/src/components/Card"
click node_form_controls "https://github.com/inkonchain/ink-kit/tree/main/src/components/Checkbox"
click node_input "https://github.com/inkonchain/ink-kit/blob/main/src/components/Input/Input.tsx"
click node_list_item "https://github.com/inkonchain/ink-kit/blob/main/src/components/ListItem/ListItem.tsx"
click node_listbox "https://github.com/inkonchain/ink-kit/tree/main/src/components/Listbox"
click node_modal "https://github.com/inkonchain/ink-kit/blob/main/src/components/Modal/Modal.tsx"
click node_modal_state "https://github.com/inkonchain/ink-kit/blob/main/src/components/Modal/ModalContext.tsx"
click node_popover "https://github.com/inkonchain/ink-kit/tree/main/src/components/Popover"
click node_segmented "https://github.com/inkonchain/ink-kit/blob/main/src/components/SegmentedControl/SegmentedControl.tsx"
click node_slot "https://github.com/inkonchain/ink-kit/blob/main/src/components/Slot/Slot.tsx"
click node_other_components "https://github.com/inkonchain/ink-kit/tree/main/src/components"
click node_effects "https://github.com/inkonchain/ink-kit/blob/main/src/components/Effects/PlaceholderUntilLoaded.tsx"
click node_layout "https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkLayout/InkLayout.tsx"
click node_navigation "https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkLayout/InkNavLink.tsx"
click node_mobile_navigation "https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkLayout/MobileNav/InkLayoutMobileNav.tsx"
click node_layout_parts "https://github.com/inkonchain/ink-kit/tree/main/src/layout/InkParts"
click node_ink_panel "https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkParts/InkPanel.tsx"
click node_icons "https://github.com/inkonchain/ink-kit/blob/main/src/icons/AllIcons.tsx"
click node_wallet "https://github.com/inkonchain/ink-kit/blob/main/src/components/Wallet/ConnectWallet.tsx"
click node_wallet_config "https://github.com/inkonchain/ink-kit/blob/main/src/providers.index.ts"
click node_ens_name "https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useEnsNameOrDefault.ts"
click node_ens_image "https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useEnsImageOrDefault.ts"
click node_breakpoint "https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useWindowBreakpoint.ts"
click node_window_size "https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useWindowSize.ts"
click node_classes "https://github.com/inkonchain/ink-kit/blob/main/src/util/classes.ts"
click node_trim "https://github.com/inkonchain/ink-kit/blob/main/src/util/trim.ts"
click node_mocks "https://github.com/inkonchain/ink-kit/blob/main/src/util/mocks.ts"
click node_theme_hook "https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useInkThemeClass.ts"

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_controls,node_alert,node_button,node_card,node_form_controls,node_input,node_list_item,node_listbox,node_modal,node_modal_state,node_popover,node_segmented,node_slot,node_other_components,node_effects toneBlue
class node_layout,node_navigation,node_mobile_navigation,node_layout_parts,node_ink_panel toneAmber
class node_wallet,node_wallet_config,node_ens_name,node_ens_image toneMint
class node_breakpoint,node_window_size,node_classes,node_trim,node_mocks,node_theme_hook toneRose
class node_entry,node_component_exports,node_icons,node_app toneIndigo
```

## Components

### UI Components

- [UI controls](https://github.com/inkonchain/ink-kit/tree/main/src/components): `src/components`
- [Alert](https://github.com/inkonchain/ink-kit/blob/main/src/components/Alert/Alert.tsx): `src/components/Alert/Alert.tsx`
- [Button](https://github.com/inkonchain/ink-kit/blob/main/src/components/Button/Button.tsx): `src/components/Button/Button.tsx`
- [Card and content](https://github.com/inkonchain/ink-kit/tree/main/src/components/Card): `src/components/Card`
- [Form controls](https://github.com/inkonchain/ink-kit/tree/main/src/components/Checkbox): `src/components/Checkbox`
- [Input](https://github.com/inkonchain/ink-kit/blob/main/src/components/Input/Input.tsx): `src/components/Input/Input.tsx`
- [List item](https://github.com/inkonchain/ink-kit/blob/main/src/components/ListItem/ListItem.tsx): `src/components/ListItem/ListItem.tsx`
- [Listbox](https://github.com/inkonchain/ink-kit/tree/main/src/components/Listbox): `src/components/Listbox`
- [Modal](https://github.com/inkonchain/ink-kit/blob/main/src/components/Modal/Modal.tsx): `src/components/Modal/Modal.tsx`
- [Modal state](https://github.com/inkonchain/ink-kit/blob/main/src/components/Modal/ModalContext.tsx): `src/components/Modal/ModalContext.tsx`
- [Popover](https://github.com/inkonchain/ink-kit/tree/main/src/components/Popover): `src/components/Popover`
- [Segmented control](https://github.com/inkonchain/ink-kit/blob/main/src/components/SegmentedControl/SegmentedControl.tsx): `src/components/SegmentedControl/SegmentedControl.tsx`
- [Slot composition](https://github.com/inkonchain/ink-kit/blob/main/src/components/Slot/Slot.tsx): `src/components/Slot/Slot.tsx`
- [Display components](https://github.com/inkonchain/ink-kit/tree/main/src/components): `src/components`
- [Loading effects](https://github.com/inkonchain/ink-kit/blob/main/src/components/Effects/PlaceholderUntilLoaded.tsx): `src/components/Effects/PlaceholderUntilLoaded.tsx`

### Layouts

- [App layout](https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkLayout/InkLayout.tsx): `src/layout/InkLayout/InkLayout.tsx`
- [Navigation links](https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkLayout/InkNavLink.tsx): `src/layout/InkLayout/InkNavLink.tsx`
- [Mobile navigation](https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkLayout/MobileNav/InkLayoutMobileNav.tsx): `src/layout/InkLayout/MobileNav/InkLayoutMobileNav.tsx`
- [Layout parts](https://github.com/inkonchain/ink-kit/tree/main/src/layout/InkParts): `src/layout/InkParts`
- [Ink panel](https://github.com/inkonchain/ink-kit/blob/main/src/layout/InkParts/InkPanel.tsx): `src/layout/InkParts/InkPanel.tsx`

### Wallet Integration

- [Connect wallet](https://github.com/inkonchain/ink-kit/blob/main/src/components/Wallet/ConnectWallet.tsx): `src/components/Wallet/ConnectWallet.tsx`
- [Wagmi configuration](https://github.com/inkonchain/ink-kit/blob/main/src/providers.index.ts): `src/providers.index.ts`
- [ENS name lookup](https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useEnsNameOrDefault.ts): `src/hooks/useEnsNameOrDefault.ts`
- [ENS image lookup](https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useEnsImageOrDefault.ts): `src/hooks/useEnsImageOrDefault.ts`

### Shared Runtime

- [Breakpoint hook](https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useWindowBreakpoint.ts): `src/hooks/useWindowBreakpoint.ts`
- [Window size hook](https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useWindowSize.ts): `src/hooks/useWindowSize.ts`
- [Class utilities](https://github.com/inkonchain/ink-kit/blob/main/src/util/classes.ts): `src/util/classes.ts`
- [Address formatting](https://github.com/inkonchain/ink-kit/blob/main/src/util/trim.ts): `src/util/trim.ts`
- [Mock account](https://github.com/inkonchain/ink-kit/blob/main/src/util/mocks.ts): `src/util/mocks.ts`
- [Theme class hook](https://github.com/inkonchain/ink-kit/blob/main/src/hooks/useInkThemeClass.ts): `src/hooks/useInkThemeClass.ts`

### Public API

- [Package entry](https://github.com/inkonchain/ink-kit/blob/main/src/index.ts): `src/index.ts`
- [Component exports](https://github.com/inkonchain/ink-kit/blob/main/src/components/index.ts): `src/components/index.ts`
- [Icon set](https://github.com/inkonchain/ink-kit/blob/main/src/icons/AllIcons.tsx): `src/icons/AllIcons.tsx`

### Other components

- **Consuming application**

## Connections

- Consuming application → Package entry: imports
- Package entry → Component exports: re-exports (evidence: `src/index.ts`)
- Component exports → Alert: exports (evidence: `src/components/index.ts`)
- Component exports → Button: exports (evidence: `src/components/index.ts`)
- Component exports → Card and content: exports (evidence: `src/components/index.ts`)
- Component exports → Form controls: exports (evidence: `src/components/index.ts`)
- Component exports → Input: exports (evidence: `src/components/index.ts`)
- Component exports → List item: exports (evidence: `src/components/index.ts`)
- Component exports → Listbox: exports (evidence: `src/components/index.ts`)
- Component exports → Modal: exports (evidence: `src/components/index.ts`)
- Component exports → Popover: exports (evidence: `src/components/index.ts`)
- Component exports → Segmented control: exports (evidence: `src/components/index.ts`)
- Component exports → Display components: exports (evidence: `src/components/index.ts`)
- Button → Class utilities: uses classes (evidence: `src/components/Button/Button.tsx`)
- Button → Slot composition: composes with (evidence: `src/components/Button/Button.tsx`)
- Segmented control → Class utilities: uses classes (evidence: `src/components/SegmentedControl/SegmentedControl.tsx`)
- Segmented control → Slot composition: uses slot (evidence: `src/components/SegmentedControl/SegmentedControl.tsx`)
- Segmented control → Window size hook: reads dimensions (evidence: `src/components/SegmentedControl/SegmentedControl.tsx`)
- Modal state → Modal: provides state
- Mobile navigation → Navigation links: renders links (evidence: `src/layout/InkLayout/MobileNav/InkLayoutMobileNav.tsx`)
- Navigation links → Class utilities: uses classes (evidence: `src/layout/InkLayout/InkNavLink.tsx`)
- Navigation links → Slot composition: uses slot (evidence: `src/layout/InkLayout/InkNavLink.tsx`)
- Ink panel → Class utilities: uses classes (evidence: `src/layout/InkParts/InkPanel.tsx`)
- App layout → Navigation links: uses navigation
- App layout → Layout parts: uses parts
- Connect wallet → Button: renders button (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → Popover: renders popover (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → Icon set: uses icons (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → ENS name lookup: looks up name (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → ENS image lookup: looks up image (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → Breakpoint hook: checks width (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → Loading effects: renders placeholder (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- Connect wallet → Address formatting: formats address (evidence: `src/components/Wallet/ConnectWallet.tsx`)
- ENS name lookup → Address formatting: formats fallback (evidence: `src/hooks/useEnsNameOrDefault.ts`)
- ENS name lookup → Mock account: checks mock account (evidence: `src/hooks/useEnsNameOrDefault.ts`)
- Breakpoint hook → Window size hook: reads dimensions (evidence: `src/hooks/useWindowBreakpoint.ts`)
