Strategic enterprise performance dashboard showing revenue, EBITDA margin, net profit, headcount, sales by region, financial health, and risk assessments

Technical Blog Article — App 45: Executive Dashboard with React, TypeScript, Vite, and Fluent UI

Introduction

In App 45 — Executive Dashboard, we continue Block 3 of the ReactLab roadmap: Professional Fluent UI Applications. This block focuses on transforming basic React knowledge into enterprise-grade interface architecture using Microsoft’s Fluent UI ecosystem. According to the project roadmap, App 45 introduces enterprise dashboard composition using cards, KPI panels, responsive layout systems, and Microsoft-style visual hierarchy.

Dashboards are among the most important UI patterns in modern enterprise applications. They appear in:

  • administrative portals
  • SharePoint dashboards
  • CRM systems
  • ERP systems
  • Power BI inspired interfaces
  • analytics platforms
  • ticket systems
  • monitoring panels
  • Microsoft 365 admin experiences

An executive dashboard is not just a group of cards on the screen. Architecturally, a dashboard is:

  • a composition of reusable UI components
  • a visual representation of business state
  • a hierarchy of information
  • a layout system designed for readability
  • a scalable structure for future API integration

This application intentionally begins as a static dashboard because React applications should evolve progressively. Before introducing:

  • APIs
  • asynchronous data
  • effects
  • caching
  • reducers
  • Context API

the developer must first understand:

  • component composition
  • layout architecture
  • typed data modeling
  • declarative rendering
  • Fluent UI design systems

The React mental model remains:

Data
→ React Components
→ JSX
→ Declarative UI
→ Enterprise Dashboard

This app follows the official philosophy defined in:


1. What This App Teaches

ConceptMeaning
Dashboard compositionMultiple components forming one enterprise UI
KPI cardsVisual metric representation
Typed modelsPredictable dashboard data
Fluent UI CardsMicrosoft-style containers
Grid layoutResponsive enterprise structure
Component reuseOne card component reused multiple times
Declarative renderingUI generated from data
Static architecture firstBuilding layout before introducing APIs

The most important lesson is:

Enterprise dashboards are compositions of reusable components.

2. Create the Project

cd C:\ReactApps
New-Item bloco03 -ItemType Directory
cd bloco03
npm create vite@latest app45-executive-dashboard -- --template react-ts
cd app45-executive-dashboard
npm install
npm install @fluentui/react-components @fluentui/react-icons

Create folders:

New-Item src\components -ItemType Directory
New-Item src\models -ItemType Directory
New-Item src\data -ItemType Directory
New-Item src\styles -ItemType Directory

Create files:

New-Item src\models\ExecutiveMetric.ts -ItemType File
New-Item src\data\executiveMetrics.ts -ItemType File
New-Item src\components\MetricCard.tsx -ItemType File
New-Item src\components\ExecutiveDashboard.tsx -ItemType File
New-Item artigo.md -ItemType File

3. Final Folder Structure

app45-executive-dashboard/
src/
components/
ExecutiveDashboard.tsx
MetricCard.tsx
data/
executiveMetrics.ts
models/
ExecutiveMetric.ts
styles/
App.tsx
main.tsx
index.css
artigo.md

This structure is already preparing the project for future scaling.

FolderResponsibility
components/Reusable visual blocks
models/TypeScript contracts
data/Dashboard data source
styles/Global/custom styling
App.tsxRoot composition
main.tsxReact entry point

This follows the architecture philosophy described in the ReactLab project structure.


4. Create the Model

src\models\ExecutiveMetric.ts

export interface ExecutiveMetric {
id: number;
title: string;
value: string;
variation: string;
status: "Positive" | "Warning" | "Critical";
description: string;
}

This interface defines the shape of every dashboard metric.

Without TypeScript, dashboard data becomes unpredictable.

The interface guarantees:

  • every metric has an id
  • every metric has a title
  • every metric has a value
  • status can only be:
    • Positive
    • Warning
    • Critical

This is important because enterprise applications require predictable architecture.


5. Create the Data Layer

src\data\executiveMetrics.ts

import type { ExecutiveMetric } from "../models/ExecutiveMetric";
export const executiveMetrics: ExecutiveMetric[] = [
{
id: 1,
title: "Revenue",
value: "$1.2M",
variation: "+18%",
status: "Positive",
description: "Monthly revenue performance.",
},
{
id: 2,
title: "Customer Satisfaction",
value: "91%",
variation: "+6%",
status: "Positive",
description: "Enterprise customer satisfaction score.",
},
{
id: 3,
title: "Open Risks",
value: "14",
variation: "-3",
status: "Warning",
description: "Business risks under review.",
},
{
id: 4,
title: "Delayed Projects",
value: "5",
variation: "+2",
status: "Critical",
description: "Projects requiring leadership attention.",
},
];

This file introduces an extremely important React concept:

The UI is generated from data.

Instead of manually creating four separate cards, we create one reusable component and render it from an array.

This is declarative rendering.


6. Create the Metric Card Component

src\components\MetricCard.tsx

import {
Badge,
Body1,
Card,
CardHeader,
Caption1,
Title3,
} from "@fluentui/react-components";
import {
ArrowTrending24Regular,
Warning24Regular,
ErrorCircle24Regular,
} from "@fluentui/react-icons";
import type { ExecutiveMetric } from "../models/ExecutiveMetric";
interface MetricCardProps {
metric: ExecutiveMetric;
}
function getIcon(status: ExecutiveMetric["status"]) {
if (status === "Positive") {
return <ArrowTrending24Regular />;
}
if (status === "Warning") {
return <Warning24Regular />;
}
return <ErrorCircle24Regular />;
}
export function MetricCard({
metric,
}: MetricCardProps) {
return (
<Card
style={{
padding: "24px",
minHeight: "200px",
}}
>
<CardHeader
image={getIcon(metric.status)}
header={<Title3>{metric.title}</Title3>}
description={
<Caption1>
{metric.description}
</Caption1>
}
/>
<Body1
style={{
fontSize: "32px",
fontWeight: 700,
}}
>
{metric.value}
</Body1>
<Badge appearance="filled">
{metric.variation}
</Badge>
</Card>
);
}

7. Understanding Component Reuse

This component is reusable.

Instead of:

RevenueCard
CustomerCard
RiskCard
ProjectCard

we create:

MetricCard

and reuse it multiple times.

This is one of the core React ideas:

Reusable UI components.

The component receives props:

metric: ExecutiveMetric;

Props are component inputs.

The component becomes dynamic because the data changes.


8. Understanding Conditional Rendering

The function:

getIcon(status)

returns different icons depending on metric status.

This is conditional rendering.

Positive
→ Trending icon
Warning
→ Warning icon
Critical
→ Error icon

React components can dynamically render different UI according to data.


9. Create the Dashboard Component

src\components\ExecutiveDashboard.tsx

import {
Button,
Card,
Text,
Title1,
Title2,
} from "@fluentui/react-components";
import {
Board24Regular,
DocumentBulletList24Regular,
} from "@fluentui/react-icons";
import { executiveMetrics } from "../data/executiveMetrics";
import { MetricCard } from "./MetricCard";
export function ExecutiveDashboard() {
return (
<main
style={{
minHeight: "100vh",
backgroundColor: "#f5f5f5",
padding: "48px",
boxSizing: "border-box",
}}
>
<section
style={{
maxWidth: "1200px",
margin: "0 auto",
}}
>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
marginBottom: "32px",
}}
>
<div>
<Title1>
Executive Dashboard
</Title1>
<Text>
Enterprise KPI overview using Fluent UI.
</Text>
</div>
<Button
appearance="primary"
icon={<DocumentBulletList24Regular />}
>
Export Report
</Button>
</div>
<div
style={{
display: "grid",
gridTemplateColumns:
"repeat(auto-fit, minmax(240px, 1fr))",
gap: "20px",
}}
>
{executiveMetrics.map((metric) => (
<MetricCard
key={metric.id}
metric={metric}
/>
))}
</div>
<Card
style={{
marginTop: "32px",
padding: "24px",
}}
>
<Title2>
Business Summary
</Title2>
<Text>
Revenue performance remains positive,
while delayed projects require immediate
executive review.
</Text>
</Card>
</section>
</main>
);
}

10. Understanding map()

This line is critical:

executiveMetrics.map((metric) => (
<MetricCard
key={metric.id}
metric={metric}
/>
))

React transforms data into UI.

Conceptually:

Metric data
→ React component
→ Rendered dashboard card

This is declarative rendering.

We are not manually creating DOM nodes.

We describe the relationship:

For each metric,
render a MetricCard.

React handles the DOM updates.


11. Why key={metric.id} Matters

React requires stable keys for lists.

key={metric.id}

helps React identify elements efficiently.

Without keys:

  • React may render inefficiently
  • warnings appear
  • updates become harder to track

Keys are essential for list rendering.

Official documentation:


12. Understanding the Dashboard Grid

The dashboard uses CSS Grid:

display: "grid",
gridTemplateColumns:
"repeat(auto-fit, minmax(240px, 1fr))",

This creates a responsive layout.

Meaning:

Create as many columns as possible.
Each column must be at least 240px.
Distribute extra space equally.

This is common in:

  • admin dashboards
  • Power BI layouts
  • analytics systems
  • SharePoint webparts
  • enterprise portals

13. Why Fluent UI Matters Here

Fluent UI provides:

  • enterprise spacing
  • accessibility
  • keyboard navigation
  • Microsoft typography
  • consistent visual hierarchy
  • theme support

Instead of building dashboards manually, Fluent UI gives production-ready enterprise components.

Main components used:

  • Card
  • Badge
  • Button
  • Title
  • Text
  • CardHeader

Official documentation:


14. Create App.tsx

src\App.tsx

import { ExecutiveDashboard }
from "./components/ExecutiveDashboard";
function App() {
return <ExecutiveDashboard />;
}
export default App;

This file acts as the root composition component.


15. Create main.tsx

src\main.tsx

import React from "react";
import ReactDOM from "react-dom/client";
import {
FluentProvider,
webLightTheme,
} from "@fluentui/react-components";
import App from "./App";
import "./index.css";
ReactDOM.createRoot(
document.getElementById("root")!
).render(
<React.StrictMode>
<FluentProvider theme={webLightTheme}>
<App />
</FluentProvider>
</React.StrictMode>
);

This file:

  • mounts React
  • activates Fluent UI
  • applies Microsoft theming
  • connects React to the browser DOM

16. Create index.css

src\index.css

body {
margin: 0;
font-family: "Segoe UI", Arial, sans-serif;
}
* {
box-sizing: border-box;
}

This removes default browser spacing and applies Microsoft typography.


17. Why This App Uses No State

This app intentionally avoids:

  • useState
  • useEffect

Why?

Because the dashboard is currently static.

According to React philosophy:

Do not add state until state is necessary.

The UI is entirely derived from static data.

This is correct React architecture.

Later versions may introduce:

  • APIs
  • filters
  • sorting
  • live updates
  • loading states
  • reducers

But first we master layout composition.


18. Complete Rendering Flow

main.tsx
renders App
App
renders ExecutiveDashboard
ExecutiveDashboard
maps executiveMetrics
MetricCard
renders each KPI card
Fluent UI
styles enterprise components
ReactDOM
updates browser DOM

19. Technical Summary

ConceptExplanation
Dashboard compositionMultiple components form one UI
TypeScript interfaceDefines metric structure
Data-driven renderingUI generated from arrays
Fluent UI CardsEnterprise containers
React propsDynamic component input
CSS GridResponsive dashboard layout
Conditional renderingDifferent icons by status
Declarative UIReact derives UI from data
Component reuseOne component reused many times
FluentProviderActivates Microsoft theming

20. Concept Table

ConceptFileWhy It Matters
Metric modelExecutiveMetric.tsPredictable data
Dashboard dataexecutiveMetrics.tsCentralized data source
Reusable cardMetricCard.tsxComponent reuse
Grid layoutExecutiveDashboard.tsxEnterprise responsive structure
Fluent UIMultiple filesMicrosoft visual identity
React compositionApp.tsxSmall focused components
Declarative renderingmap()UI generated from data

21. Official Documentation

TopicDocumentation
React LearnReact Learn
Thinking in ReactThinking in React
Rendering ListsRendering Lists
Keeping Components PureKeeping Components Pure
Fluent UI ComponentsFluent UI React Components
Fluent UI CardFluent UI Card
Vite GuideVite Guide
TypeScript DocsTypeScript Docs

22. Final Architectural Insight

This app introduces one of the most important enterprise frontend patterns:

Data
→ Reusable components
→ Responsive layout
→ Executive dashboard

Modern dashboards are not handcrafted HTML pages.

They are:

  • data-driven
  • component-based
  • declarative
  • reusable
  • scalable

Mastering this structure prepares you for:

  • analytics systems
  • admin portals
  • DataGrid apps
  • SharePoint dashboards
  • Power BI inspired layouts
  • enterprise React architecture

Because in React:

Dashboards are compositions.
Components are reusable.
UI derives from data.

Current Project Progress

BlockAppNameStatus
Block 101Hello React FluentCompleted
Block 102Profile CardCompleted
Block 103Product ListCompleted
Block 104Microsoft Style User CardCompleted
Block 105Static DashboardCompleted
Block 106Corporate Sidebar MenuCompleted
Block 107Visual Task ListCompleted
Block 108Timeline EventsCompleted
Block 109Employee TableCompleted
Block 110Email ListCompleted
Block 111Grid of CardsCompleted
Block 112Image GalleryCompleted
Block 113Movie CatalogCompleted
Block 114Football TeamsCompleted
Block 115News PageCompleted
Block 116Financial DashboardCompleted
Block 117SharePoint Style LayoutCompleted
Block 118File ExplorerCompleted
Block 119Corporate PortalCompleted
Block 120Microsoft Style Landing PageCompleted
Block 221Modern CounterCompleted
Block 222Toggle ThemeCompleted
Block 223React CalculatorCompleted
Block 224Login FormCompleted
Block 225User RegistrationCompleted
Block 226Complete ToDo ListCompleted
Block 227Shopping ListCompleted
Block 228Product FilterCompleted
Block 229Employee SearchCompleted
Block 230Shopping CartCompleted
Block 231Grade SimulatorCompleted
Block 232Inventory ControlCompleted
Block 233Contact AgendaCompleted
Block 234Currency ConverterCompleted
Block 235BMI CalculatorCompleted
Block 236Installment SimulatorCompleted
Block 237Voting PanelCompleted
Block 238Interactive QuizCompleted
Block 239Team ManagerCompleted
Block 240Dynamic DashboardCompleted
Block 341Microsoft Style LoginCompleted
Block 342Corporate FormCompleted
Block 343Tabs NavigationCompleted
Block 344Dialog ManagerCompleted
Block 345Executive DashboardCurrent
Block 346DataGrid CatalogNext

Edvaldo Guimrães Filho Avatar

Published by