import { useState } from "react" import { subDays } from "date-fns" import { Activity, DollarSign, MousePointer, PieChart, ShoppingCart, TrendingUp, Users, } from "lucide-react" import { definePage } from "@squadbase/vantage" import { DashboardCard, DashboardCardAction, DashboardCardContent, DashboardCardHeader, DashboardCardPreset, DashboardCardTitle, DateRangePicker, AreaChart, BarChart, DonutChart, PageShell, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeaderEnd, PageShellHeading, PageShellSummary, PageShellSummaryCard, PageShellTitle, Placeholder, Sparkline, } from "@squadbase/vantage/components" import { CampaignTable } from "./components/kpi-chart-advanced/campaign-table" import { breakdownSlices, campaignRows, comparisonSeries, headerKpis, trendSeries, } from "./components/kpi-chart-advanced/mock-data" import type { DashboardFilters, } from "./components/kpi-chart-advanced/types" export const page = definePage({ title: "KPI + チャート (アドバンスト)", description: "ヒーローKPI (大1+小4の2×2) ・棒+折れ線比較チャート・ドーナツ・日次トレンド・明細テーブルを搭載したKPI主役のダッシュボード構成", }) // ── page ───────────────────────────────────────────────────────────────────── const today = new Date() const initialFilters: DashboardFilters = { dateRange: { from: subDays(today, 29), to: today, }, } const smallKpiCards = [ { label: "指標2", icon: Users, kpi: headerKpis[1] }, { label: "指標3", icon: MousePointer, kpi: headerKpis[2] }, { label: "指標4", icon: Activity, kpi: headerKpis[3] }, { label: "指標5", icon: ShoppingCart, kpi: headerKpis[4] }, ] export default function HomePage() { const [filters, setFilters] = useState(initialFilters) const heroKpi = headerKpis[0] return ( [テンプレート] パフォーマンスダッシュボード 選択期間の主要KPI・比較・詳細。 setFilters((prev) => ({ ...prev, dateRange: range })) } maxDate={today} />

成長

全体のパフォーマンスは前期比で上昇傾向です。

構成

単一セグメントが全体で最大のシェアを占めています。

勢い

直近の動きはトレンドの好転を示しています。

指標1
{heroKpi.value}
{heroKpi.change >= 0 ? `+${heroKpi.change}%` : `${heroKpi.change}%`}
({ value: v }))} height={88} area />

指標A

¥92万

指標B

+8.4%
{smallKpiCards.map(({ label, icon: Icon, kpi }) => ( {label} {kpi.value}
{kpi.change >= 0 ? `+${kpi.change}%` : `${kpi.change}%`}
({ value: v }))} height={32} area className="mt-3" />
))}
) }