How to Build Custom Apps with Claude Artifacts
In this article
Claude Artifacts lets you create interactive web apps, dashboards, and tools directly in a chat conversation—no separate coding environment needed. You describe what you want, and Claude writes the HTML, CSS, and JavaScript for a working prototype you can run and refine. This guide walks you through building your first custom app, from opening the Artifacts panel to publishing a finished version.
What You'll Need
- A Claude account (free or Pro) with access to Artifacts—available on the web at claude.ai and in the mobile app.
- A clear idea of what your app should do: a calculator, a to-do list, a quiz, a data visualizer, etc.
- Basic familiarity with describing features in plain English; no prior coding knowledge is required.
Step-by-Step
- Start a new chat and enable Artifacts. On the Claude web interface, click the “Artifacts” toggle in the chat input area so it’s on (blue). If you don’t see the toggle, make sure you’re using a model that supports Artifacts (e.g., Claude Sonnet or Opus).
- Describe your app in detail. Write a prompt like: “Create a simple expense tracker app. It should have a form to add an expense with amount and category, a list of entries, and a total at the bottom. Use a clean, modern design.” The more specific you are about features and layout, the better the first result.
- Review the generated artifact. Claude will produce an artifact—a preview pane that shows your app running. You’ll see tabs for “Preview” and “Code.” Start with Preview to test the functionality.
- Test the app interactively. Click buttons, enter data, and see if everything works as expected. If something is broken or missing, tell Claude what’s wrong in the chat, e.g., “The total isn’t updating when I add an expense.”
- Iterate with follow-up prompts. Ask for changes: “Add a delete button next to each expense,” “Make the design dark mode,” “Add a chart showing expenses by category.” Claude will update the artifact in place.
- Use the code tab for manual tweaks. If you’re comfortable with code, open the Code tab to adjust CSS styles, change text, or fix logic. You can edit directly and see the preview update.
- Copy the code for external use. When you’re happy, click the “Copy” button in the artifact header to copy the full HTML/CSS/JS code. You can paste it into a file (e.g.,
index.html) and open it in any browser, or host it on a service like GitHub Pages or Netlify. - Share or publish. For sharing within Claude, you can send the chat link to others. For a public web app, upload the copied code to a static hosting service. Follow that service’s instructions for deploying a single HTML file.
Common Mistakes
- Being too vague. “Make a useful app” won’t give you a useful result. Specify the core function, inputs, outputs, and visual style.
- Expecting a production-ready app. Artifacts are best for prototypes and simple tools. They don’t connect to databases or handle user authentication by default.
- Ignoring the preview. The code might look fine, but the preview shows actual behavior. Always test the interactive elements.
- Asking for too many features at once. Break down your requests into small, testable increments.
- Not using the Code tab for fine control. If you know a little CSS, you can fix spacing or colors faster than describing them.
Tips
- Start with a simple app and add features gradually. This keeps the code manageable and reduces bugs.
- Use concrete examples in your prompts: “Like a Pomodoro timer with a 25-minute countdown and a reset button.”
- If the app doesn’t work as expected, describe the exact step that fails: “When I click ‘Add’, nothing appears in the list.”
- Ask for comments in the code: “Add comments to explain each function.” This helps you understand and modify it later.
- Save your best prompts for reuse. A well-written prompt can be adapted for similar apps.
Troubleshooting
If the artifact doesn’t appear: Make sure the Artifacts toggle is on. If it’s already on, try refreshing the page or starting a new chat. Some models or account tiers may not support Artifacts—check your plan.
If the preview is blank: Look at the Code tab for errors. Sometimes a JavaScript error stops the whole app. Copy the code and run it in your browser’s console (F12) to see the error message. Then tell Claude the error text.
If buttons don’t respond: Check that the JavaScript is correctly wired. Ask Claude to “make sure the button’s onclick event is attached.” In the Code tab, verify that element IDs match between HTML and JS.
If the layout looks broken: Ask for a responsive design: “Make it work on mobile screens.” Claude can adjust the CSS. If you’re editing code yourself, check for missing closing tags or mismatched braces.
If you lose the artifact: Artifacts are tied to the chat. Scroll up in the conversation to find it, or click the artifact icon in the chat history. You can also copy the code before closing the chat.
Frequently Asked Questions
Can I use Claude Artifacts for free?
Yes, free accounts can create and use artifacts, but there may be daily usage limits. Pro and Max plans offer higher limits and access to more advanced models.
Can I build a multi-page app with Artifacts?
Artifacts are single-page apps. You can simulate multiple pages with tabs or conditional views, but you can’t have separate HTML files. For a true multi-page site, you’d need to copy the code and split it yourself.
Can the app save data after I close the browser?
No. Artifacts run in your browser and data is lost on refresh unless you use localStorage. You can ask Claude to “use localStorage to save the data,” which will persist in your browser, but it’s not a real database.
Can I use external APIs in my artifact?
Yes, you can make fetch requests to public APIs, but note that CORS restrictions may apply. Ask Claude to “fetch data from [API URL]” and it will include error handling. For APIs requiring keys, you’ll need to embed them, which is insecure for public apps—use only public APIs for prototypes.
Can I collaborate with others on an artifact?
Not in real time. You can share the chat link with others, and they can view the artifact and continue the conversation, but simultaneous editing isn’t supported.
Can I export my artifact as a React or Vue app?
Not directly. Artifacts are plain HTML/CSS/JS. You can ask Claude to rewrite the code in React, but you’d need to set up a React environment yourself. For simple apps, plain HTML is easier to deploy.