shadcn-report 1.0.0: single-file HTML reports with shadcn/ui + Magic UI #10

Merged
trtmn merged 1 commit from feat/shadcn-report into main 2026-11-18 20:26:37 +00:00
Owner

What

New plugin shadcn-report: builds polished, self-contained HTML reports from shadcn/ui and Magic UI components. Every component is installed with the shadcn CLI via npx, and the output is bundled into one portable .html file. PDF export is optional.

How it works

Script Does
init-report.sh <slug> npx shadcn@latest init -t vite -b radix -p <preset>, adds the default shadcn + @magicui/* components, wires vite-plugin-singlefile, applies the starter template
build-report.sh <project> --out x.html tsc -b && vite build → single fully-inlined HTML (checks nothing leaked out of the bundle)
export-pdf.sh x.html headless Chrome PDF in static mode, with the window sized to the CSS @page so Recharts charts don't clip

Projects live in ~/.cache/shadcn-reports/<slug>/ (about 300 MB of node_modules, kept out of git repos) and can be edited and rebuilt later.

Non-obvious problems it handles

  • Prompts: the shadcn CLI shows a preset picker even with -y. The scripts pass every option explicitly and close stdin.
  • Blank prints: Magic UI NumberTicker starts at 0 and BlurFade starts invisible, so prints, PDFs, and screenshots came out empty. useStaticMode() (?static, reduced motion, beforeprint) feeds <Kpi> and <Reveal> so they render final values.
  • Gray charts: neutral presets ship gray --chart-* values. The template adds shadcn's colorful palette for light and dark.
  • Clipped PDF charts: Recharts measures its width on screen and doesn't re-measure for paper. CSS overrides on the SVG collapsed it to 0×0. Matching the window width to the printable width fixed it.

Testing

Ran manually end to end on a fresh scaffold (init with --add alert, then build, then PDF):

  • HTML is 0.94 MB, fully_inlined: true
  • Screenshots checked in light and dark, both ?static and animated
  • The PDF text contains the exact KPI values, and the chart's last x-axis label is present, so the chart isn't clipped
  • The PII sweep from AGENTS.md is clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01QAQzaNVALrNcxVcmKaoZUD

## What New plugin **`shadcn-report`**: builds polished, self-contained HTML reports from shadcn/ui and Magic UI components. Every component is installed with the shadcn CLI via `npx`, and the output is bundled into **one portable `.html` file**. PDF export is optional. ## How it works | Script | Does | |---|---| | `init-report.sh <slug>` | `npx shadcn@latest init -t vite -b radix -p <preset>`, adds the default shadcn + `@magicui/*` components, wires `vite-plugin-singlefile`, applies the starter template | | `build-report.sh <project> --out x.html` | `tsc -b && vite build` → single fully-inlined HTML (checks nothing leaked out of the bundle) | | `export-pdf.sh x.html` | headless Chrome PDF in static mode, with the window sized to the CSS `@page` so Recharts charts don't clip | Projects live in `~/.cache/shadcn-reports/<slug>/` (about 300 MB of `node_modules`, kept out of git repos) and can be edited and rebuilt later. ## Non-obvious problems it handles - **Prompts:** the shadcn CLI shows a preset picker even with `-y`. The scripts pass every option explicitly and close stdin. - **Blank prints:** Magic UI `NumberTicker` starts at 0 and `BlurFade` starts invisible, so prints, PDFs, and screenshots came out empty. `useStaticMode()` (`?static`, reduced motion, `beforeprint`) feeds `<Kpi>` and `<Reveal>` so they render final values. - **Gray charts:** neutral presets ship gray `--chart-*` values. The template adds shadcn's colorful palette for light and dark. - **Clipped PDF charts:** Recharts measures its width on screen and doesn't re-measure for paper. CSS overrides on the SVG collapsed it to 0×0. Matching the window width to the printable width fixed it. ## Testing Ran manually end to end on a fresh scaffold (init with `--add alert`, then build, then PDF): - HTML is 0.94 MB, `fully_inlined: true` - Screenshots checked in light and dark, both `?static` and animated - The PDF text contains the exact KPI values, and the chart's last x-axis label is present, so the chart isn't clipped - The PII sweep from AGENTS.md is clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QAQzaNVALrNcxVcmKaoZUD
New plugin that scaffolds a Vite + React + Tailwind v4 report project with
the shadcn CLI (npx shadcn@latest init/add), pulls Magic UI components from
the built-in @magicui registry, and bundles everything into one
self-contained HTML file via vite-plugin-singlefile.

- init-report.sh / build-report.sh / export-pdf.sh (JSON to stdout)
- starter report template with <Kpi>, <Reveal>, useStaticMode() so
  NumberTicker/BlurFade render final values in print, PDF and screenshots
- colorful chart palette (neutral presets ship gray --chart-*) + print CSS
- references/components.md: report-suitable components and CLI discovery

Claude-Session: https://claude.ai/code/session_01QAQzaNVALrNcxVcmKaoZUD
trtmn merged commit a46bf8fc7d into main 2026-11-18 20:26:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
CR1
CR2
CR3
CR4
CR5
P0
P1
P2
P3
P4
P5
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
trtmn/agent-plugins!10
No description provided.