We use cookies
We use cookies to enhance your experience and analyse site usage.
Printable dashboard layout with KPI cards, chart areas, and data tables.
<!DOCTYPE html>
<html>
<head>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, sans-serif; color: #1e293b; padding: 32px; background: #f8fafc; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.dashboard-header h1 { font-size: 22px; font-weight: 700; }
.dashboard-header p { font-size: 13px; color: #64748b; margin-top: 3px; }
.date-badge { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 14px; font-size: 13px; color: #64748b; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: white; border-radius: 10px; border: 1px solid #e2e8f0; padding: 20px; }
.kpi .label { font-size: 12px; color: #64748b; font-weight: 500; margin-bottom: 8px; }
.kpi .value { font-size: 26px; font-weight: 800; color: #1e293b; }
.kpi .trend { font-size: 12px; font-weight: 600; margin-top: 6px; }
.pos { color: #16a34a; } .neg { color: #dc2626; }
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.card { background: white; border-radius: 10px; border: 1px solid #e2e8f0; padding: 20px; }
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 16px; color: #1e293b; }
.chart-placeholder { background: #f8fafc; border: 2px dashed #e2e8f0; border-radius: 8px; height: 140px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; background: #f8fafc; }
td { padding: 10px 12px; border-top: 1px solid #f1f5f9; }
.status { display: inline-flex; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.active { background: #dcfce7; color: #16a34a; } .pending { background: #fef3c7; color: #d97706; }
</style>
</head>
<body>
<div class="dashboard-header">
<div><h1>{{dashboard_title}}</h1><p>{{subtitle}}</p></div>
<div class="date-badge">{{report_period}}</div>
</div>
<div class="kpis">
<div class="kpi"><div class="label">Total Revenue</div><div class="value">{{revenue}}</div><div class="trend pos">↑ {{revenue_change}} vs last month</div></div>
<div class="kpi"><div class="label">New Customers</div><div class="value">{{customers}}</div><div class="trend pos">↑ {{customers_change}}</div></div>
<div class="kpi"><div class="label">Conversion Rate</div><div class="value">{{conversion}}</div><div class="trend neg">↓ {{conversion_change}}</div></div>
<div class="kpi"><div class="label">Avg. Order Value</div><div class="value">{{aov}}</div><div class="trend pos">↑ {{aov_change}}</div></div>
</div>
<div class="charts">
<div class="card"><div class="card-title">Revenue Over Time</div><div class="chart-placeholder">Chart: {{chart_note}}</div></div>
<div class="card"><div class="card-title">Traffic by Source</div><div class="chart-placeholder">Chart: {{pie_chart_note}}</div></div>
</div>
<div class="card">
<div class="card-title">Top Transactions</div>
<table>
<thead><tr><th>Customer</th><th>Product</th><th>Amount</th><th>Date</th><th>Status</th></tr></thead>
<tbody>{{table_rows}}</tbody>
</table>
</div>
</body>
</html>Sign in to open this template in the playground, or copy the HTML and use it with the API.
curl -X POST https://api.htmlpdf.dev/api/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<!DOCTYPE html>\n<html>\n<head>\n<style>\n * { box-sizing: border-box; margin: 0; p...",
"format": "A4"
}' \
--output analytics-dashboard.pdf