root = Card([header, kpiBlock, pipelineSection, openRolesSection, interviewsSection, chartsSection, actionButtons])
header = CardHeader("Hiring Overview", "HR Dashboard · Live as of April 2026")
kpiBlock = SnippetCardBlock([kpiHeadcount, kpiOpenRoles, kpiTimeToHire, kpiInterviews], "grid", true)
kpiHeadcount = SnippetCardItem("headcount", kpiHCLhs, kpiHCRhs)
kpiHCLhs = IconText(kpiHCIcon, "neutral", "m", "Current Headcount", "Full-time employees", false, "horizontal")
kpiHCIcon = Icon("users", "people")
kpiHCRhs = BoldText("number", "342", "+12 this quarter", "metric")
kpiOpenRoles = SnippetCardItem("open-roles", kpiORLhs, kpiORRhs)
kpiORLhs = IconText(kpiORIcon, "neutral", "m", "Open Roles", "Across all departments", false, "horizontal")
kpiORIcon = Icon("briefcase", "business")
kpiORRhs = BoldText("number", "28", "14 Engineering", "metric")
kpiTimeToHire = SnippetCardItem("time-to-hire", kpiTTLhs, kpiTTRhs)
kpiTTLhs = IconText(kpiTTIcon, "neutral", "m", "Avg Time to Hire", "Rolling 90-day window", false, "horizontal")
kpiTTIcon = Icon("clock", "time")
kpiTTRhs = BoldText("number", "42 days", "-5 days vs last quarter", "metric")
kpiInterviews = SnippetCardItem("interviews-week", kpiIntLhs, kpiIntRhs)
kpiIntLhs = IconText(kpiIntIcon, "neutral", "m", "Interviews This Week", "Scheduled across pipeline", false, "horizontal")
kpiIntIcon = Icon("calendar", "time")
kpiIntRhs = BoldText("number", "47", "12 final-round", "metric")
pipelineSection = SectionBlock([secPipeline], false)
secPipeline = SectionItem("pipeline", "Candidate Pipeline", [pipelineHeader, pipelineChart, pipelineTable])
pipelineHeader = InlineHeader("Candidates by Stage", "Total active candidates: 184")
pipelineChart = HorizontalBarChart(pipelineStages, [pipelineSeries], "grouped", "Candidates", "Stage")
pipelineStages = ["Applied", "Screening", "Technical", "Onsite", "Offer", "Hired"]
pipelineSeries = Series("Count", [89, 34, 28, 19, 11, 3])
pipelineTable = Table([colStage, colCount, colConversion, colAvgDays])
colStage = Col("Stage", pipelineStages, "string")
colCount = Col("Candidates", [89, 34, 28, 19, 11, 3], "number")
colConversion = Col("Conversion", ["38.2%", "82.4%", "67.9%", "57.9%", "27.3%", "—"], "string")
colAvgDays = Col("Avg Days in Stage", [3, 5, 7, 10, 4, "—"], "string")
openRolesSection = SectionBlock([secOpenRoles], false)
secOpenRoles = SectionItem("open-roles", "Open Roles by Department", [openRolesHeader, openRolesTable])
openRolesHeader = InlineHeader("28 Open Positions", "Filter by department or role type")
openRolesTable = Table([colRole, colDept, colType, colPriority, colPosted, colApplicants, colStatus])
colRole = Col("Role", ["Senior Backend Engineer", "Frontend Engineer", "DevOps Engineer", "ML Engineer", "Engineering Manager", "Product Designer", "Product Manager", "Technical Writer", "Sales Development Rep", "Account Executive", "Customer Success Manager", "Marketing Manager", "Content Strategist", "HR Business Partner", "Recruiter", "Finance Analyst", "Legal Counsel", "IT Support Specialist"], "string")
colDept = Col("Department", ["Engineering", "Engineering", "Engineering", "Engineering", "Engineering", "Product", "Product", "Product", "Sales", "Sales", "Sales", "Marketing", "Marketing", "People", "People", "Finance", "Legal", "IT"], "string")
colType = Col("Type", ["Full-time", "Full-time", "Full-time", "Full-time", "Full-time", "Full-time", "Full-time", "Contract", "Full-time", "Full-time", "Full-time", "Full-time", "Contract", "Full-time", "Full-time", "Full-time", "Full-time", "Full-time"], "string")
colPriority = Col("Priority", ["Critical", "High", "High", "Medium", "Critical", "High", "High", "Medium", "High", "Critical", "Medium", "Medium", "Low", "High", "High", "Medium", "Low", "Low"], "string")
colPosted = Col("Posted", ["2026-03-15", "2026-03-20", "2026-03-22", "2026-04-01", "2026-02-28", "2026-03-18", "2026-03-25", "2026-04-05", "2026-03-10", "2026-03-05", "2026-03-28", "2026-04-02", "2026-04-10", "2026-03-12", "2026-03-30", "2026-04-08", "2026-04-12", "2026-04-14"], "string")
colApplicants = Col("Applicants", [47, 32, 28, 19, 12, 41, 35, 23, 56, 29, 38, 24, 18, 31, 27, 15, 8, 42], "number")
colStatus = Col("Status", ["Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active"], "string")
interviewsSection = SectionBlock([secInterviews], false)
secInterviews = SectionItem("interviews", "Interviews Scheduled This Week (47 total)", [interviewsHeader, interviewsList])
interviewsHeader = InlineHeader("Upcoming Interviews", "Click a candidate to view details")
interviewsList = ListBlock([int1, int2, int3, int4, int5, int6, int7, int8], "number", "small")
int1 = ListItem("Sarah Chen — Senior Backend Engineer", "Engineering · Technical Interview · Mon 10:00 AM · Zoom", null, null, { type: "continue_conversation", context: "Show interview details for Sarah Chen" })
int2 = ListItem("Marcus Johnson — Frontend Engineer", "Engineering · Onsite · Tue 9:30 AM · Office", null, null, { type: "continue_conversation", context: "Show interview details for Marcus Johnson" })
int3 = ListItem("Priya Patel — DevOps Engineer", "Engineering · Screening · Mon 2:00 PM · Phone", null, null, { type: "continue_conversation", context: "Show interview details for Priya Patel" })
int4 = ListItem("David Kim — ML Engineer", "Engineering · Technical Interview · Wed 11:00 AM · Zoom", null, null, { type: "continue_conversation", context: "Show interview details for David Kim" })
int5 = ListItem("Emily Rodriguez — Product Designer", "Product · Portfolio Review · Tue 3:00 PM · Zoom", null, null, { type: "continue_conversation", context: "Show interview details for Emily Rodriguez" })
int6 = ListItem("James Wilson — Account Executive", "Sales · Final Round · Thu 10:00 AM · Office", null, null, { type: "continue_conversation", context: "Show interview details for James Wilson" })
int7 = ListItem("Lisa Thompson — HR Business Partner", "People · Behavioral · Wed 1:00 PM · Zoom", null, null, { type: "continue_conversation", context: "Show interview details for Lisa Thompson" })
int8 = ListItem("Robert Brown — IT Support Specialist", "IT · Technical Assessment · Fri 9:00 AM · Office", null, null, { type: "continue_conversation", context: "Show interview details for Robert Brown" })
chartsSection = SectionBlock([secDeptSplit, secAttrition], false)
secDeptSplit = SectionItem("dept-split", "Headcount by Department", [deptHeader, deptChart, deptTable])
deptHeader = InlineHeader("342 Total Employees", "Distribution across 8 departments")
deptChart = PieChart(deptLabels, deptValues, "donut", "circular")
deptLabels = ["Engineering", "Product", "Sales", "Marketing", "People", "Finance", "Legal", "IT"]
deptValues = [128, 34, 42, 28, 18, 22, 12, 58]
deptTable = Table([colDeptName, colHeadcount, colOpenRoles, colAttritionRate])
colDeptName = Col("Department", deptLabels, "string")
colHeadcount = Col("Headcount", [128, 34, 42, 28, 18, 22, 12, 58], "number")
colOpenRoles = Col("Open Roles", [14, 3, 4, 2, 2, 1, 1, 1], "number")
colAttritionRate = Col("Attrition (6mo)", ["8.2%", "5.9%", "12.1%", "7.1%", "0%", "4.5%", "0%", "10.3%"], "string")
secAttrition = SectionItem("attrition", "Attrition Trend (Last 6 Months)", [attritionHeader, attritionChart, attritionSummary])
attritionHeader = InlineHeader("Rolling 6-Month Attrition", "Overall rate: 8.4% · Industry benchmark: 10.2%")
attritionChart = LineChart(attritionMonths, [attritionSeries], "natural", "Month", "Attrition Rate (%)")
attritionMonths = ["Nov 2025", "Dec 2025", "Jan 2026", "Feb 2026", "Mar 2026", "Apr 2026"]
attritionSeries = Series("Monthly Attrition %", [1.8, 1.4, 1.6, 1.2, 1.1, 1.3])
attritionSummary = EntityList([attr1, attr2, attr3, attr4], "default", { left: "Metric", right: "Value", rightVariant: "text" }, { left: "Total Departures", right: "29", rightVariant: "number" })
attr1 = { left: "Voluntary", right: "24", rightVariant: "number" }
attr2 = { left: "Involuntary", right: "5", rightVariant: "number" }
attr3 = { left: "Top Exit Reason", right: "Career Growth (42%)", rightVariant: "text" }
attr4 = { left: "Regrettable Attrition", right: "68%", rightVariant: "number" }
actionButtons = Buttons([btnNewRole, btnExport, btnSettings], "row")
btnNewRole = Button("Open New Role", { type: "continue_conversation", context: "Open a new role requisition form" }, "primary")
btnExport = Button("Export Report", { type: "continue_conversation", context: "Export hiring dashboard as PDF" }, "secondary")
btnSettings = Button("Dashboard Settings", { type: "continue_conversation", context: "Configure hiring dashboard views and alerts" }, "tertiary")