Build powerful frontend claude.ai artifacts by following these steps:
- Use
scripts/init-artifact.shto initialize the frontend repository - Develop the artifact by editing the generated code
- Use
scripts/bundle-artifact.shto bundle all code into a single HTML file - Show the artifact to the user
- (Optional) Test the artifact
Tech Stack: React 18 + TypeScript + Vite + Parcel (bundling) + Tailwind CSS + shadcn/ui
Design and Styling Guidelines
Very important: To avoid what is often called "AI slop," avoid overly centered layouts, purple gradients, uniform rounded corners, and the Inter font.
Quick Start
Step 1: Initialize the project
Run the initialization script to create a new React project:
bash scripts/init-artifact.sh
cd
This creates a fully configured project, including:
- ✅ React + TypeScript (via Vite)
- ✅ Tailwind CSS 3.4.1 with the shadcn/ui theme system
- ✅ Path aliases (
@/) configured - ✅ 40+ shadcn/ui components preinstalled
- ✅ All Radix UI dependencies included
- ✅ Parcel configured for bundling (via .parcelrc)
- ✅ Node 18+ compatibility (automatically detects and pins the Vite version)
Step 2: Develop the artifact
Edit the generated files to build the artifact. See "Common Development Tasks" below for guidance.
Step 3: Bundle into a single HTML file
Bundle the React app into a single HTML artifact:
bash scripts/bundle-artifact.sh
This creates bundle.html — a self-contained artifact with all JavaScript, CSS, and dependencies inlined. This file can be shared directly as an artifact in a Claude conversation.
Requirement: The project must have index.html。
What the script does:
- Install bundling dependencies (parcel, @parcel/config-default, parcel-resolver-tspaths, html-inline)
- Create a
.parcelrcconfiguration with path alias support - Build with Parcel (no source maps)
- Inline all assets into a single HTML using html-inline
Step 4: Share the artifact with the user
Finally, share the bundled HTML file in the conversation so they can view it as an artifact.
Step 5: Test/visualize the artifact (optional)
Note: This is a completely optional step. Only do it when necessary or requested.
To test/visualize the artifact, use available tools (including other skills or built-in tools such as Playwright or Puppeteer). Generally, avoid testing the artifact in advance, as it adds latency between the request and being able to see the finished artifact. If requested or if issues arise, test it later after presenting the artifact.
Reference
- shadcn/ui components:https://ui.shadcn.com/docs/components