Skip to content

The Open Standard for Generative UI

3.4 KB
Raw Blame
root = Stack([headerCard, kpiRow, chartsRow1, featuresCard, revenueCard], "column", "l")
headerCard = Card([header], "card")
header = CardHeader("Product Analytics Dashboard", "Usage, acquisition, feature adoption, and revenue trends")
kpiRow = Stack([kpi1, kpi2, kpi3, kpi4], "row", "m", "stretch", "start", true)
kpi1 = Card([kpi1Title, kpi1Value, kpi1Note], "sunk")
kpi1Title = TextContent("Monthly Active Users (MAU)", "small-heavy")
kpi1Value = TextContent("128,400", "large-heavy")
kpi1Note = TextContent("+6.2% vs last month", "small")
kpi2 = Card([kpi2Title, kpi2Value, kpi2Note], "sunk")
kpi2Title = TextContent("New Users (30d)", "small-heavy")
kpi2Value = TextContent("24,950", "large-heavy")
kpi2Note = TextContent("+3.1% vs last 30d", "small")
kpi3 = Card([kpi3Title, kpi3Value, kpi3Note], "sunk")
kpi3Title = TextContent("MRR", "small-heavy")
kpi3Value = TextContent("$412,000", "large-heavy")
kpi3Note = TextContent("+4.4% MoM", "small")
kpi4 = Card([kpi4Title, kpi4Value, kpi4Note], "sunk")
kpi4Title = TextContent("ARR", "small-heavy")
kpi4Value = TextContent("$4.94M", "large-heavy")
kpi4Note = TextContent("+18.7% YoY", "small")
chartsRow1 = Stack([mauCard, acquisitionCard], "row", "l", "stretch", "start", true)
mauCard = Card([mauHeader, mauChart], "card")
mauHeader = CardHeader("Monthly Active Users", "Last 12 months")
mauChart = BarChart(mauLabels, [mauSeries], "grouped", "Month", "Users")
mauLabels = ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar"]
mauSeries = Series("MAU", [84500, 87200, 90100, 93800, 96500, 100200, 104800, 109600, 114300, 119900, 123700, 128400])
acquisitionCard = Card([acqHeader, acqChart, acqLegendNote], "card")
acqHeader = CardHeader("User Acquisition", "Share of new users (last 30 days)")
acqChart = PieChart(acqSlices, "donut")
acqSlices = [acq1, acq2, acq3, acq4, acq5]
acq1 = Slice("Organic Search", 34)
acq2 = Slice("Paid Search", 22)
acq3 = Slice("Referrals", 16)
acq4 = Slice("Social", 12)
acq5 = Slice("Direct / Other", 16)
acqLegendNote = TextContent("Tip: Track CAC and conversion rate by channel to explain mix shifts.", "small")
featuresCard = Card([featuresHeader, featuresTable], "card")
featuresHeader = CardHeader("Top Features", "Adoption and engagement (last 30 days)")
featuresTable = Table(featureCols, featureRows)
featureCols = [Col("Feature", "string"), Col("Weekly Active Users", "number"), Col("Adoption Rate (%)", "number"), Col("Avg. Uses / User", "number")]
featureRows = [["Dashboards", 48200, 62.5, 5.8], ["Automations", 31750, 41.2, 3.1], ["Integrations", 28900, 37.5, 2.4], ["Team Collaboration", 27100, 35.2, 4.6], ["Exports", 19850, 25.8, 1.7], ["Alerts", 17600, 22.9, 2.0], ["API Access", 12150, 15.8, 6.3]]
revenueCard = Card([revenueHeader, revenueChart, revenueNote], "card")
revenueHeader = CardHeader("Revenue Trend", "MRR and ARR (last 12 months)")
revenueChart = LineChart(revLabels, [mrrSeries, arrSeries], "natural", "Month", "USD")
revLabels = ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar"]
mrrSeries = Series("MRR ($)", [332000, 341000, 349000, 356000, 364000, 372000, 381000, 389000, 397000, 404000, 408000, 412000])
arrSeries = Series("ARR ($)", [3984000, 4092000, 4188000, 4272000, 4368000, 4464000, 4572000, 4668000, 4764000, 4848000, 4896000, 4944000])
revenueNote = TextContent("ARR shown as 12×MRR for directional tracking; replace with contracted ARR if you track annual commitments.", "small")