Skip to content
Docksoft

Web Artifacts Builder

A

web-artifacts-builder

Build complex HTML artifacts using React, Vite, Tailwind CSS, and shadcn/ui components.

artifactsreactvitetailwindshadcn

Install

npx skills add anthropics/web-artifacts-builder
Author
Anthropic
License
Apache-2.0
Updated
February 2026
Type
Single skill
Document
3.0 KB
Platforms
Claude Code, Claude Ai
View source

SKILL.md

Web Artifacts Builder

To build powerful frontend claude.ai artifacts, follow these steps:

  1. Initialize the frontend repo using scripts/init-artifact.sh
  2. Develop your artifact by editing the generated code
  3. Bundle all code into a single HTML file using scripts/bundle-artifact.sh
  4. Display artifact to user
  5. (Optional) Test the artifact

Stack: React 18 + TypeScript + Vite + Parcel (bundling) + Tailwind CSS + shadcn/ui

Design & Style Guidelines

VERY IMPORTANT: To avoid what is often referred to as "AI slop", avoid using excessive centered layouts, purple gradients, uniform rounded corners, and Inter font.

Quick Start

Step 1: Initialize Project

Run the initialization script to create a new React project:

bash scripts/init-artifact.sh <project-name>
cd <project-name>

This creates a fully configured project with:

  • ✅ React + TypeScript (via Vite)
  • ✅ Tailwind CSS 3.4.1 with shadcn/ui theming system
  • ✅ Path aliases (@/) configured
  • ✅ 40+ shadcn/ui components pre-installed
  • ✅ All Radix UI dependencies included
  • ✅ Parcel configured for bundling (via .parcelrc)
  • ✅ Node 18+ compatibility (auto-detects and pins Vite version)

Step 2: Develop Your Artifact

To build the artifact, edit the generated files. See Common Development Tasks below for guidance.

Step 3: Bundle to Single HTML File

To 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 directly shared in Claude conversations as an artifact.

Requirements: Your project must have an index.html in the root directory.

What the script does:

  • Installs bundling dependencies (parcel, @parcel/config-default, parcel-resolver-tspaths, html-inline)
  • Creates .parcelrc config with path alias support
  • Builds with Parcel (no source maps)
  • Inlines all assets into single HTML using html-inline

Step 4: Share Artifact with User

Finally, share the bundled HTML file in conversation with the user so they can view it as an artifact.

Step 5: Testing/Visualizing the Artifact (Optional)

Note: This is a completely optional step. Only perform if necessary or requested.

To test/visualize the artifact, use available tools (including other Skills or built-in tools like Playwright or Puppeteer). In general, avoid testing the artifact upfront as it adds latency between the request and when the finished artifact can be seen. Test later, after presenting the artifact, if requested or if issues arise.

Reference

When to use it

  • Building multi-component claude.ai artifacts with React + Tailwind + shadcn/ui
  • Artifacts that need state management, routing, or composed UI components
  • Complex interactive demos or prototype apps as artifacts

When not to

  • Simple single-file HTML or JSX artifacts (default artifact tools handle these)
  • Non-claude.ai HTML / JS work — use `frontend-design` instead
  • Server-side React (Next.js apps) — artifacts run client-only

Questions

What components are available?
The full shadcn/ui component library plus React 18 + Tailwind. State via React hooks; routing via lightweight in-artifact navigation.
Can artifacts persist data?
Only within the artifact's lifetime — there's no backend or storage. Use props / state for transient data and ask the user to copy results out for anything you need to keep.

Related

Web Development

A

Composition Patterns

composition-patterns

React composition patterns that scale — avoids boolean prop proliferation through compound components, render props, and React 19 APIs.

claude-codecodexcursor+2MIT

Web Development

B

Frontend Slides

frontend-slides

Generate animation-rich HTML presentations with visual style previews.

claude-codeMIT

Web Development

S

Next.js Best Practices

next-best-practices

Next.js performance optimization and best practices for server components, routing, and data fetching.

claude-codecodexcursor+1MIT

Agent tooling

Want agents that know your stack?

This index is ours, and so is the tooling behind it. If your team wants agents that understand how your own systems actually work, that is a thing we build.

Contact the dock

One address, read by the people who would do the work. No intake form, no calendar link — just an email.

tphamdn@gmail.com
Other reasons to writeWe reply within two business days