Charts Blocks based on shadcn/ui
KPI row showing domain rating, articles published, backlinks, and SEO provider status. Includes a 12-month domain rating trend sparkline chart.
SEO Analytics
Domain Rating
46/100
Articles Published
87
last 3 months
Backlinks
234
SEO Provider
DataForSEO
ActiveDomain rating has grown from 18 to 46 over 12 months.
Last synced: May 8, 2025 at 09:14 AM · Metrics from DataForSEO
"use client"
import * as React from "react"
import { BarChart2, RefreshCw, TrendingUp } from "lucide-react"
import { Badge } from "@/registry/creative-tim/ui/badge"
import { Button } from "@/registry/creative-tim/ui/button"
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/registry/creative-tim/ui/card"
const DR_HISTORY = [18, 22, 24, 25, 28, 31, 35, 38, 40, 42, 44, 46]
const MONTHS = [
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
]
function Sparkline({ data }: { data: number[] }) {
const max = Math.max(...data)
const min = Math.min(...data)
const range = max - min || 1
const height = 40
const width = 200
const points = data
.map((v, i) => {
const x = (i / (data.length - 1)) * width
const y = height - ((v - min) / range) * height
return `${x},${y}`
})
.join(" ")
return (
<svg
viewBox={`0 0 ${width} ${height}`}
className="h-10 w-full text-orange-500"
>
<polyline
points={points}
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
)
}
export function BlogWriterSeoAnalytics01() {
return (
<div className="mx-auto max-w-4xl space-y-6 p-6">
<div className="flex items-center justify-between">
<h1 className="text-base font-semibold">SEO Analytics</h1>
<Button variant="outline" size="sm">
<RefreshCw className="mr-1.5 h-3.5 w-3.5" />
Refresh
</Button>
</div>
{/* KPI row */}
<div className="grid grid-cols-2 gap-4 md:grid-cols-4">
<Card>
<CardContent className="px-4 py-3">
<p className="text-muted-foreground text-xs">Domain Rating</p>
<p className="text-2xl font-bold">
46
<span className="text-muted-foreground text-sm font-normal">
/100
</span>
</p>
<div className="mt-1 flex items-center gap-1 text-xs text-emerald-600">
<TrendingUp className="h-3 w-3" />
+4 this month
</div>
</CardContent>
</Card>
<Card>
<CardContent className="px-4 py-3">
<p className="text-muted-foreground text-xs">Articles Published</p>
<p className="text-2xl font-bold">87</p>
<p className="text-muted-foreground mt-1 text-xs">last 3 months</p>
</CardContent>
</Card>
<Card>
<CardContent className="px-4 py-3">
<p className="text-muted-foreground text-xs">Backlinks</p>
<p className="text-2xl font-bold">234</p>
<div className="mt-1 flex items-center gap-1 text-xs text-emerald-600">
<TrendingUp className="h-3 w-3" />
+18 this month
</div>
</CardContent>
</Card>
<Card>
<CardContent className="px-4 py-3">
<p className="text-muted-foreground text-xs">SEO Provider</p>
<p className="mt-1 text-sm font-medium">DataForSEO</p>
<Badge
variant="outline"
className="mt-1 border-emerald-200 bg-emerald-50 text-xs text-emerald-700"
>
Active
</Badge>
</CardContent>
</Card>
</div>
{/* Domain rating trend */}
<Card>
<CardHeader className="pb-2">
<CardTitle className="text-sm">Domain Rating Trend</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<Sparkline data={DR_HISTORY} />
<div className="text-muted-foreground flex justify-between text-xs">
{MONTHS.map((m) => (
<span key={m}>{m}</span>
))}
</div>
<p className="text-muted-foreground text-xs">
Domain rating has grown from {DR_HISTORY[0]} to{" "}
{DR_HISTORY[DR_HISTORY.length - 1]} over 12 months.
</p>
</CardContent>
</Card>
<p className="text-muted-foreground text-xs">
Last synced: May 8, 2025 at 09:14 AM · Metrics from DataForSEO
</p>
</div>
)
}
Overview balance bar chart with year selector dropdown (2024, 2023, 2022), view report button, and currency-formatted value display. Features custom tooltips and legend for analyzing sales data across months.
Sales Overview
Monthly performance metrics
Total Balance
$87,982.00
import BarChartExample from "@/components/creative-tim/blocks/bar-chart-example"
export default function Page() {
return <BarChartExample />
}
Three metric cards displaying Website View (area chart), Daily Sales (line chart), and Completed Tasks (linear chart) with icons and campaign performance labels. Perfect for dashboard overviews.
PRO Blocks
This is a PRO block. Upgrade your account to access the source code and install this block via CLI/MCP.
Upgrade to PROWebsite Views
2,490
Daily Sales
$2,490
Completed Tasks
2,490
import CardChartsExample1 from "@/components/creative-tim/blocks/card-charts-example-1"
export default function Page() {
return <CardChartsExample1 />
}
Three metric cards with charts (line, bar, line) showing Website View, Daily Sales, and Completed Tasks. Each card includes a footer with timestamp indicating when the campaign was sent.
PRO Blocks
This is a PRO block. Upgrade your account to access the source code and install this block via CLI/MCP.
Upgrade to PROWebsite Views
Last Campaign Performance
Campaign sent 2 days ago
Daily Sales
15% increase in today sales
Campaign sent 2 days ago
Completed Tasks
Last Campaign Performance
Campaign sent 2 days ago
import CardChartsExample2 from "@/components/creative-tim/blocks/card-charts-example-2"
export default function Page() {
return <CardChartsExample2 />
}
Team Productivity Tracker showing comparison chart between 2024 and 2023 with percentage badge (+30%), view report button, and multi-line visualization. Perfect for tracking year-over-year performance.
PRO Blocks
This is a PRO block. Upgrade your account to access the source code and install this block via CLI/MCP.
Upgrade to PROTeam Productivity Tracker
Tasks completed 2023
7,982.80
+30%import ComparisonChartWidget from "@/components/creative-tim/blocks/comparison-chart-widget"
export default function Page() {
return <ComparisonChartWidget />
}
Annual Sales Performance chart comparing 2024 vs 2023 with currency-formatted value display, footer section with title and description, and view report button. Perfect for year-to-date sales analysis.
PRO Blocks
This is a PRO block. Upgrade your account to access the source code and install this block via CLI/MCP.
Upgrade to PRO$127,092.22
Annual Sales Performance
Year-to-Date sales comparison
import LineChartBlock from "@/components/creative-tim/blocks/line-chart"
export default function Page() {
return <LineChartBlock />
}
Website Views Traffic chart with year selector dropdown, view report button, and currency-formatted value display showing unique views breakdown. Features interactive year selection for 2024, 2023, and 2022.
PRO Blocks
This is a PRO block. Upgrade your account to access the source code and install this block via CLI/MCP.
Upgrade to PROWebsite Views Traffic
Unique Views Breakdown
$87,982.00
import SingleLineChart from "@/components/creative-tim/blocks/single-line-chart"
export default function Page() {
return <SingleLineChart />
}
Four KPI cards in a responsive grid (lg:grid-cols-4) — Monthly Revenue, Active Users, Avg. Session, Churn Rate. Each shows the metric value, percentage change badge (top-right), subtext, and a 12-point sparkline chart. Churn rate inverts color logic (down = green).
Monthly Revenue
12.5%$84,200
$9,420 today
Active Users
8.2%12,430
1,204 new this week
Avg. Session
3.1%4m 12s
vs 4m 04s last month
Churn Rate
0.8%2.4%
−0.8pp vs last month
import KpiSparklineCards from "@/components/creative-tim/blocks/kpi-sparkline-cards"
export default function Page() {
return <KpiSparklineCards />
}
Revenue area chart with 7D/1M/3M/1Y time-range tab selector. Uses ComposedChart with Area for current period (gradient fill) and Line for previous period (dashed, renders on top). Large metric display with trend percentage.
Total Revenue
vs. previous period
import AreaChartGradient from "@/components/creative-tim/blocks/area-chart-gradient"
export default function Page() {
return <AreaChartGradient />
}
Composed bar + line chart for sales vs target. Bars show monthly actual revenue, amber dashed line shows target. Header badges display total actual and achievement percentage with green/amber color coding based on whether target is met.
Sales vs Target
Monthly actual vs target — FY 2024
import ComboChartTarget from "@/components/creative-tim/blocks/combo-chart-target"
export default function Page() {
return <ComboChartTarget />
}
Donut chart with total budget in center label, 5 categories, hover-to-highlight interaction that dims non-hovered segments. Legend shows category name, percentage, and dollar value with progress bars. Used for budget, market share, or composition breakdowns.
Budget Breakdown
Annual operating expenses by category
import DonutChartBreakdown from "@/components/creative-tim/blocks/donut-chart-breakdown"
export default function Page() {
return <DonutChartBreakdown />
}
Top Traffic card with 3-tab switcher (Pages / Sources / Devices). Each tab shows top-5 entries ranked by visit count. Each row has a rank number, label, visit count, change badge (green/red), and a CSS progress bar proportional to the top entry.
Top Traffic
Last 30 days · 56,700 total visits
import BarListMetrics from "@/components/creative-tim/blocks/bar-list-metrics"
export default function Page() {
return <BarListMetrics />
}