home / skills / eyadsibai / ltk / react-artifacts

This skill helps you build and bundle React artifacts into a single HTML file using Tailwind and shadcn UI.

npx playbooks add skill eyadsibai/ltk --skill react-artifacts

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.5 KB
---
name: react-artifacts
description: Use when "building React artifacts", "creating HTML artifacts", "bundling React apps", "single HTML file", or asking about "artifact builder", "shadcn components", "Tailwind artifacts"
version: 1.0.0
---

<!-- Adapted from: awesome-claude-skills/artifacts-builder -->

# React Artifacts Builder

Create elaborate, multi-component claude.ai HTML artifacts using React, Tailwind CSS, and shadcn/ui.

## When to Use

- Building complex React artifacts for claude.ai
- Creating interactive demos needing state management
- Using shadcn/ui components in artifacts
- Bundling React apps into single HTML files
- NOT for simple single-file HTML/JSX artifacts

## Stack

- React 18 + TypeScript + Vite
- Parcel (bundling)
- Tailwind CSS
- shadcn/ui (40+ pre-installed components)

## Workflow

1. **Initialize** - Create project with init script
2. **Develop** - Build your artifact
3. **Bundle** - Convert to single HTML file
4. **Share** - Display artifact to user

## Project Initialization

```bash
# Create new artifact project
bash scripts/init-artifact.sh <project-name>
cd <project-name>
```

Creates project with:

- React + TypeScript via Vite
- Tailwind CSS with shadcn theming
- Path aliases (@/) configured
- 40+ shadcn/ui components pre-installed
- All Radix UI dependencies
- Parcel configured for bundling

## Bundling to Single HTML

```bash
# Bundle entire React app to one HTML file
bash scripts/bundle-artifact.sh
```

Creates `bundle.html` - self-contained artifact with all JS, CSS, and dependencies inlined.

## Design Guidelines

**Avoid "AI slop"**:

- No excessive centered layouts
- No purple gradients
- No uniform rounded corners
- Vary from Inter font

**Best Practices**:

- Match content to subject
- Clear visual hierarchy
- Consistent patterns
- Accessible design

## shadcn/ui Components

Reference: <https://ui.shadcn.com/docs/components>

Pre-installed components include:

- Button, Card, Dialog, Drawer
- Form, Input, Select, Checkbox
- Table, Tabs, Toast
- And many more...

## Example Structure

```tsx
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"

export default function App() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>My Artifact</CardTitle>
      </CardHeader>
      <CardContent>
        <Button>Click me</Button>
      </CardContent>
    </Card>
  )
}
```

## Tips

- Develop normally, bundle at the end
- Test in browser before bundling
- Keep bundle size reasonable
- Use Tailwind for responsive design

Overview

This skill lets you build and bundle production-ready React artifacts into a single self-contained HTML file for use in Claude workflows or any environment that accepts an HTML artifact. It provides a Vite + React + TypeScript starter with Tailwind CSS and 40+ preinstalled shadcn/ui components so you can compose interactive, accessible UI quickly. Use it when you need stateful demos, component-driven layouts, or a fully inlined distributable artifact.

How this skill works

The workflow scaffolds a React project with path aliases, Tailwind and shadcn/ui, and configures Parcel for inlining. You develop with Vite locally, compose UI using shadcn components and Tailwind, then run the bundling script to produce a single bundle.html that contains all CSS, JS, and assets inlined. Test the artifact in a browser, adjust styles and size, and then share the single HTML file as the final artifact.

When to use it

  • Building multi-component React artifacts for Claude or similar AI UI hosts
  • Creating interactive demos that need React state and component composition
  • Using shadcn/ui components and Tailwind for consistent design
  • Bundling a React app into one distributable HTML file
  • When you need a shareable, offline-capable UI preview

Best practices

  • Develop with Vite and test in a real browser before bundling
  • Keep bundle size reasonable: avoid large unused dependencies and heavy images
  • Use Tailwind utility classes and shadcn components for consistent visual patterns
  • Follow accessible design: clear hierarchy, labels, and keyboard focus management
  • Avoid generic “AI” clichés—match style to subject and vary typography and shapes

Example use cases

  • An interactive demo of a data flow or decision tree using React state and shadcn components
  • A single-file UI preview to include with documentation or a ticket
  • A compact, shareable prototype for user testing without server hosting
  • A component gallery showcasing shadcn/ui elements and Tailwind variants
  • A bundled interactive form or settings panel that can be embedded in other tools

FAQ

What stack does this use?

React 18 + TypeScript + Vite for development, Tailwind CSS and shadcn/ui for UI, and Parcel for bundling to a single HTML file.

How do I create the project and bundle it?

Run the provided init script to scaffold the project, develop with Vite, then run the bundle script to produce bundle.html with all JS/CSS inlined.