Technology Stack
React 19
Latest React with Compiler for automatic optimizations
TailwindCSS 4
Utility-first CSS with latest v4 features
Motion
Animations (Framer Motion successor)
Vite 7
Fast development and optimized builds
package.json:95 (React 19.2.4)
Route-Based Architecture
Flow Browser uses a route-based structure where each window type has its own route. Routes Directory:src/renderer/src/routes/
Available Routes
main-ui - Primary Browser Interface
main-ui - Primary Browser Interface
Path:
flow-internal://main-uiComponent: src/renderer/src/routes/main-ui/page.tsx:1The main browser chrome rendered in each browser window:- Tabbar with tab management
- Address bar / omnibox
- Sidebar with navigation
- Window controls
- Extension toolbar
popup-ui - Extension Popup Interface
popup-ui - Extension Popup Interface
Path:
flow-internal://popup-uiComponent: src/renderer/src/routes/popup-ui/page.tsxMinimal browser UI for popup windows created by web pages.settings - Settings Window
settings - Settings Window
Path:
flow-internal://settingsComponent: src/renderer/src/routes/settings/page.tsxComplete settings interface:- General preferences
- Privacy & security
- Appearance customization
- Spaces/profiles management
- Keyboard shortcuts
- Extensions management
new-tab - New Tab Page
new-tab - New Tab Page
Path:
flow://new-tabComponent: src/renderer/src/routes/new-tab/page.tsxDefault new tab page with:- Search box
- Shortcuts
- Customizable background
omnibox - Address Bar Suggestions
omnibox - Address Bar Suggestions
Path:
flow-internal://omniboxComponent: src/renderer/src/routes/omnibox/page.tsxFloating omnibox window shown when typing in address bar:- Search suggestions
- History results
- Bookmark matches
- Calculator
- Quick actions
onboarding - First Run Wizard
onboarding - First Run Wizard
Path:
flow-internal://onboardingComponent: src/renderer/src/routes/onboarding/page.tsxFirst-run onboarding flow for new users.extensions - Extension Manager
extensions - Extension Manager
Path:
flow://extensionsComponent: src/renderer/src/routes/extensions/page.tsxChrome Web Store-style extension management interface.pdf-viewer - Built-in PDF Viewer
pdf-viewer - Built-in PDF Viewer
Path:
flow://pdf-viewerComponent: src/renderer/src/routes/pdf-viewer/page.tsxFull-featured PDF viewer using @pdfslick/react:- Zoom controls
- Page navigation
- Annotations
- Search
Component Architecture
Main Browser UI
The primary browser interface is built from composable components:Component Categories
- Browser UI
- Settings
- UI Library
- Logic
Location:
src/renderer/src/components/browser-ui/Core browser interface components:tabbar/- Tab strip and tab componentstoolbar/- Address bar, navigation buttonssidebar/- Sidebar with bookmarks, historywindow-controls/- Platform-specific window controls (macOS, Linux, Windows)update-effect.tsx- Update notification UI
Flow API Access
The renderer process accesses main process functionality through the Flow API exposed by preload.API Structure
Type Definition:src/shared/flow/flow.ts:30
Usage Examples
State Management
Flow Browser uses a hybrid state approach:IPC Subscriptions
Tab State
Tab State
Tab state is managed in the main process and pushed to renderer via IPC:Why: Tab state lives in main process (WebContentsView lifecycle), renderer reflects it.
UI State
UI State
UI-specific state (sidebar open, settings panel) uses standard React state:Why: Purely UI state with no main process involvement.
Settings
Settings
Settings are persisted in main process, accessed via IPC:Why: Settings need to persist across sessions and be accessible to main process.
Custom Hooks
Location:src/renderer/src/hooks/
- use-debounce
- use-force-update
- use-bounding-rect
File:
src/renderer/src/hooks/use-debounce.tsxDebounce rapidly changing values:Styling with TailwindCSS 4
Flow Browser uses TailwindCSS 4 with the new Oxide engine.Tailwind Configuration
Tailwind Configuration
Tailwind is configured via Vite plugin:Custom theme tokens defined in CSS:
Component Styling Pattern
Animations with Motion
Flow uses Motion (Framer Motion v12) for animations. Package:package.json:91 (motion 12.34.3)
Import from
motion/react, NOT framer-motion:Animation Examples
Build & Development
Development Mode
electron.vite.config.ts
Production Build
React Compiler
Flow Browser uses the React Compiler for automatic optimizations. Plugin:package.json:73 (babel-plugin-react-compiler)
The compiler automatically:
- Memoizes components
- Optimizes re-renders
- Eliminates unnecessary useCallback/useMemo
Next Steps
IPC Communication
Learn how renderer and main process communicate
Main Process
Understand the backend architecture