# twbs/bootstrap architecture

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

- Interactive diagram: https://gitdiagram.com/twbs/bootstrap
- Repository: https://github.com/twbs/bootstrap

## Overview

Bootstrap is a front-end framework whose JavaScript components turn DOM markup and user interactions into accessible interface behavior; developers access those components through the JavaScript entry point. The repository also contains an Astro-based documentation site. The graph groups related UI components and shows the shared component lifecycle and DOM support layer. Some component relationships are based on the SOURCE INDEX rather than inspected implementation excerpts, so unsampled internal behavior is not expanded.

Main entry points: [`js/src/index.ts`](https://github.com/twbs/bootstrap/blob/main/js/src/index.ts) (JavaScript exports), [`js/src/base-component.ts`](https://github.com/twbs/bootstrap/blob/main/js/src/base-component.ts) (Component lifecycle), [`site/src/libs/remark.ts`](https://github.com/twbs/bootstrap/blob/main/site/src/libs/remark.ts) (Content processing), [`site/src/libs/config.ts`](https://github.com/twbs/bootstrap/blob/main/site/src/libs/config.ts) (Site configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Public API"]
  node_js_api["JavaScript exports<br/>[index.ts]"]
end

subgraph group_ui["UI Components"]
  node_feedback["Feedback and alerts<br/>[alert.ts]"]
  node_navigation["Navigation controls<br/>[menu.ts]"]
  node_nav_extras["Navigation overflow<br/>[nav-overflow.ts]"]
  node_disclosure["Disclosure controls<br/>[collapse.ts]"]
  node_tabs["Tabs<br/>[tab.ts]"]
  node_dialogs["Dialogs and drawers<br/>[dialog-base.ts]"]
  node_dialog_impl["Dialog behavior<br/>[dialog.ts]"]
  node_drawer_impl["Drawer behavior<br/>[drawer.ts]"]
  node_carousel["Carousel<br/>[carousel.ts]"]
  node_scrollspy["Scroll tracking<br/>[scrollspy.ts]"]
  node_date_input["Date selection<br/>[datepicker.ts]"]
  node_form_controls["Form controls<br/>[combobox.ts]"]
  node_chips["Chips input<br/>[chips.ts]"]
  node_otp["One-time code input<br/>[otp-input.ts]"]
  node_strength["Strength indicator<br/>[strength.ts]"]
  node_range["Range control<br/>[range.ts]"]
  node_overlays["Floating overlays<br/>[tooltip.ts]"]
  node_popover["Popover<br/>[popover.ts]"]
  node_toast["Toast<br/>[toast.ts]"]
end

subgraph group_runtime["Runtime Foundations"]
  node_base["Component lifecycle<br/>[base-component.ts]"]
  node_config["Component configuration<br/>[config.ts]"]
  node_events["DOM event handling<br/>[event-handler.ts]"]
  node_selectors["DOM selection<br/>[selector-engine.ts]"]
  node_data_attrs["DOM data attributes<br/>[manipulator.ts]"]
  node_floating["Floating placement<br/>[floating-ui.ts]"]
end

subgraph group_docs["Documentation Site"]
  node_docs["Astro documentation<br/>[astro.config.ts]"]
  node_site_config["Site configuration<br/>[config.ts]"]
  node_site_paths["Site paths<br/>[path.ts]"]
  node_site_content["Content processing<br/>[remark.ts]"]
end

node_developer(("Framework developer"))

node_developer -->|"imports components"| node_js_api
node_js_api -->|"exports"| node_feedback
node_js_api -->|"exports"| node_navigation
node_js_api -->|"exports"| node_nav_extras
node_js_api -->|"exports"| node_disclosure
node_js_api -->|"exports"| node_tabs
node_js_api -->|"exports"| node_dialogs
node_js_api -->|"exports"| node_dialog_impl
node_js_api -->|"exports"| node_drawer_impl
node_js_api -->|"exports"| node_carousel
node_js_api -->|"exports"| node_scrollspy
node_js_api -->|"exports"| node_date_input
node_js_api -->|"exports"| node_form_controls
node_js_api -->|"exports"| node_chips
node_js_api -->|"exports"| node_otp
node_js_api -->|"exports"| node_strength
node_js_api -->|"exports"| node_range
node_js_api -->|"exports"| node_overlays
node_js_api -->|"exports"| node_popover
node_js_api -->|"exports"| node_toast
node_base -->|"inherits configuration"| node_config
node_base -->|"registers and removes events"| node_events
node_base -->|"resolves elements"| node_selectors
node_config -->|"reads data settings"| node_data_attrs
node_navigation -->|"parses responsive placement"| node_floating
node_overlays -->|"parses responsive placement"| node_floating
node_docs -->|"loads configuration"| node_site_config
node_docs -->|"configures content processing"| node_site_content
node_site_content -->|"uses configuration"| node_site_config
node_site_content -->|"uses paths"| node_site_paths
node_site_paths -->|"reads settings"| node_site_config

click node_js_api "https://github.com/twbs/bootstrap/blob/main/js/src/index.ts"
click node_feedback "https://github.com/twbs/bootstrap/blob/main/js/src/alert.ts"
click node_navigation "https://github.com/twbs/bootstrap/blob/main/js/src/menu.ts"
click node_nav_extras "https://github.com/twbs/bootstrap/blob/main/js/src/nav-overflow.ts"
click node_disclosure "https://github.com/twbs/bootstrap/blob/main/js/src/collapse.ts"
click node_tabs "https://github.com/twbs/bootstrap/blob/main/js/src/tab.ts"
click node_dialogs "https://github.com/twbs/bootstrap/blob/main/js/src/dialog-base.ts"
click node_dialog_impl "https://github.com/twbs/bootstrap/blob/main/js/src/dialog.ts"
click node_drawer_impl "https://github.com/twbs/bootstrap/blob/main/js/src/drawer.ts"
click node_carousel "https://github.com/twbs/bootstrap/blob/main/js/src/carousel.ts"
click node_scrollspy "https://github.com/twbs/bootstrap/blob/main/js/src/scrollspy.ts"
click node_date_input "https://github.com/twbs/bootstrap/blob/main/js/src/datepicker.ts"
click node_form_controls "https://github.com/twbs/bootstrap/blob/main/js/src/combobox.ts"
click node_chips "https://github.com/twbs/bootstrap/blob/main/js/src/chips.ts"
click node_otp "https://github.com/twbs/bootstrap/blob/main/js/src/otp-input.ts"
click node_strength "https://github.com/twbs/bootstrap/blob/main/js/src/strength.ts"
click node_range "https://github.com/twbs/bootstrap/blob/main/js/src/range.ts"
click node_overlays "https://github.com/twbs/bootstrap/blob/main/js/src/tooltip.ts"
click node_popover "https://github.com/twbs/bootstrap/blob/main/js/src/popover.ts"
click node_toast "https://github.com/twbs/bootstrap/blob/main/js/src/toast.ts"
click node_base "https://github.com/twbs/bootstrap/blob/main/js/src/base-component.ts"
click node_config "https://github.com/twbs/bootstrap/blob/main/js/src/util/config.ts"
click node_events "https://github.com/twbs/bootstrap/blob/main/js/src/dom/event-handler.ts"
click node_selectors "https://github.com/twbs/bootstrap/blob/main/js/src/dom/selector-engine.ts"
click node_data_attrs "https://github.com/twbs/bootstrap/blob/main/js/src/dom/manipulator.ts"
click node_floating "https://github.com/twbs/bootstrap/blob/main/js/src/util/floating-ui.ts"
click node_docs "https://github.com/twbs/bootstrap/blob/main/site/astro.config.ts"
click node_site_config "https://github.com/twbs/bootstrap/blob/main/site/src/libs/config.ts"
click node_site_paths "https://github.com/twbs/bootstrap/blob/main/site/src/libs/path.ts"
click node_site_content "https://github.com/twbs/bootstrap/blob/main/site/src/libs/remark.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_js_api toneBlue
class node_feedback,node_navigation,node_nav_extras,node_disclosure,node_tabs,node_dialogs,node_dialog_impl,node_drawer_impl,node_carousel,node_scrollspy,node_date_input,node_form_controls,node_chips,node_otp,node_strength,node_range,node_overlays,node_popover,node_toast toneAmber
class node_base,node_config,node_events,node_selectors,node_data_attrs,node_floating toneMint
class node_docs,node_site_config,node_site_paths,node_site_content toneRose
class node_developer toneIndigo
```

## Components

### Public API

- [JavaScript exports](https://github.com/twbs/bootstrap/blob/main/js/src/index.ts): `js/src/index.ts`

### UI Components

- [Feedback and alerts](https://github.com/twbs/bootstrap/blob/main/js/src/alert.ts): `js/src/alert.ts`
- [Navigation controls](https://github.com/twbs/bootstrap/blob/main/js/src/menu.ts): `js/src/menu.ts`
- [Navigation overflow](https://github.com/twbs/bootstrap/blob/main/js/src/nav-overflow.ts): `js/src/nav-overflow.ts`
- [Disclosure controls](https://github.com/twbs/bootstrap/blob/main/js/src/collapse.ts): `js/src/collapse.ts`
- [Tabs](https://github.com/twbs/bootstrap/blob/main/js/src/tab.ts): `js/src/tab.ts`
- [Dialogs and drawers](https://github.com/twbs/bootstrap/blob/main/js/src/dialog-base.ts): `js/src/dialog-base.ts`
- [Dialog behavior](https://github.com/twbs/bootstrap/blob/main/js/src/dialog.ts): `js/src/dialog.ts`
- [Drawer behavior](https://github.com/twbs/bootstrap/blob/main/js/src/drawer.ts): `js/src/drawer.ts`
- [Carousel](https://github.com/twbs/bootstrap/blob/main/js/src/carousel.ts): `js/src/carousel.ts`
- [Scroll tracking](https://github.com/twbs/bootstrap/blob/main/js/src/scrollspy.ts): `js/src/scrollspy.ts`
- [Date selection](https://github.com/twbs/bootstrap/blob/main/js/src/datepicker.ts): `js/src/datepicker.ts`
- [Form controls](https://github.com/twbs/bootstrap/blob/main/js/src/combobox.ts): `js/src/combobox.ts`
- [Chips input](https://github.com/twbs/bootstrap/blob/main/js/src/chips.ts): `js/src/chips.ts`
- [One-time code input](https://github.com/twbs/bootstrap/blob/main/js/src/otp-input.ts): `js/src/otp-input.ts`
- [Strength indicator](https://github.com/twbs/bootstrap/blob/main/js/src/strength.ts): `js/src/strength.ts`
- [Range control](https://github.com/twbs/bootstrap/blob/main/js/src/range.ts): `js/src/range.ts`
- [Floating overlays](https://github.com/twbs/bootstrap/blob/main/js/src/tooltip.ts): `js/src/tooltip.ts`
- [Popover](https://github.com/twbs/bootstrap/blob/main/js/src/popover.ts): `js/src/popover.ts`
- [Toast](https://github.com/twbs/bootstrap/blob/main/js/src/toast.ts): `js/src/toast.ts`

### Runtime Foundations

- [Component lifecycle](https://github.com/twbs/bootstrap/blob/main/js/src/base-component.ts): `js/src/base-component.ts`
- [Component configuration](https://github.com/twbs/bootstrap/blob/main/js/src/util/config.ts): `js/src/util/config.ts`
- [DOM event handling](https://github.com/twbs/bootstrap/blob/main/js/src/dom/event-handler.ts): `js/src/dom/event-handler.ts`
- [DOM selection](https://github.com/twbs/bootstrap/blob/main/js/src/dom/selector-engine.ts): `js/src/dom/selector-engine.ts`
- [DOM data attributes](https://github.com/twbs/bootstrap/blob/main/js/src/dom/manipulator.ts): `js/src/dom/manipulator.ts`
- [Floating placement](https://github.com/twbs/bootstrap/blob/main/js/src/util/floating-ui.ts): `js/src/util/floating-ui.ts`

### Documentation Site

- [Astro documentation](https://github.com/twbs/bootstrap/blob/main/site/astro.config.ts): `site/astro.config.ts`
- [Site configuration](https://github.com/twbs/bootstrap/blob/main/site/src/libs/config.ts): `site/src/libs/config.ts`
- [Site paths](https://github.com/twbs/bootstrap/blob/main/site/src/libs/path.ts): `site/src/libs/path.ts`
- [Content processing](https://github.com/twbs/bootstrap/blob/main/site/src/libs/remark.ts): `site/src/libs/remark.ts`

### Other components

- **Framework developer**

## Connections

- Framework developer → JavaScript exports: imports components (evidence: `README.md`)
- JavaScript exports → Feedback and alerts: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Navigation controls: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Navigation overflow: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Disclosure controls: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Tabs: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Dialogs and drawers: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Dialog behavior: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Drawer behavior: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Carousel: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Scroll tracking: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Date selection: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Form controls: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Chips input: exports (evidence: `js/src/index.ts`)
- JavaScript exports → One-time code input: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Strength indicator: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Range control: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Floating overlays: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Popover: exports (evidence: `js/src/index.ts`)
- JavaScript exports → Toast: exports (evidence: `js/src/index.ts`)
- Component lifecycle → Component configuration: inherits configuration (evidence: `js/src/base-component.ts`)
- Component lifecycle → DOM event handling: registers and removes events (evidence: `js/src/base-component.ts`)
- Component lifecycle → DOM selection: resolves elements (evidence: `js/src/base-component.ts`)
- Component configuration → DOM data attributes: reads data settings (evidence: `js/src/util/config.ts`)
- Navigation controls → Floating placement: parses responsive placement (evidence: `js/src/menu.ts`)
- Floating overlays → Floating placement: parses responsive placement (evidence: `js/src/tooltip.ts`)
- Astro documentation → Site configuration: loads configuration (evidence: `site/astro.config.ts`)
- Astro documentation → Content processing: configures content processing (evidence: `site/astro.config.ts`)
- Content processing → Site configuration: uses configuration (evidence: `site/src/libs/remark.ts`)
- Content processing → Site paths: uses paths (evidence: `site/src/libs/remark.ts`)
- Site paths → Site configuration: reads settings (evidence: `site/src/libs/path.ts`)
