Agent skill

AI Elements

by xiaoiver in xiaoiver/infinite-canvas-tutorial

Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions.

MITAuto-check passedFrontend & Design

Install AI Elements

skills CLI
$ npx skills add xiaoiver/infinite-canvas-tutorial --skill ai-elements -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install xiaoiver/infinite-canvas-tutorial ai-elements --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/xiaoiver/infinite-canvas-tutorial.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/ai-elements .claude/skills/ai-elements && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ai-elements
GitHub stars
1.1k
Used in
2 other repos
Token cost
~1.9k tokens
SKILL.md length
758 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions.

  • Works in 4 steps: Verify your config file syntax is valid… → Check that the file path is correct for… → Restart your coding assistant after… → …
  • Creating new components in packages/elements/src
  • SKILL.md covers Quick Start, Prerequisites, Installing Components and Usage, plus 11 more sections
  • Calls npx; needs AI_GATEWAY_API_KEY

What it does

AI Elements is an agent skill from xiaoiver/infinite-canvas-tutorial. Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions. Use when creating new components in packages/elements/src or when the user asks to add a new component to ai-elements.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design. It works with shadcn/ui and Vercel AI SDK. The repository describes itself as: A tutorial on infinite canvas. The licence is MIT.

When your agent uses it

  • Creating new components in packages/elements/src
  • The user asks to add a new component to ai-elements

Example prompts

  • “/ai-elements”

Requirements

  • Node.js
  • A credential in AI_GATEWAY_API_KEY

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Verify your config file syntax is valid JSON.
  2. Check that the file path is correct for your AI tool.
  3. Restart your coding assistant after making changes.
  4. Ensure you have a stable internet connection.

What it can do on your machine

Read from SKILL.md and the folder at commit 0238248. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • ui.shadcn.com
    • vercel.com
    • github.com
    • npmjs.com
    • nodejs.org
    • nextjs.org
    • ai-sdk.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AI_GATEWAY_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AI Elements loads about 1.9k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 758 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from xiaoiver/infinite-canvas-tutorial at commit 0238248, republished under its MIT licence (© xiaoiver). 758 words, ~1,850 tokens.

Download SKILL.mdSave it as .claude/skills/ai-elements/SKILL.md (or your agent's skills folder).
name
ai-elements
description
Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions. Use when creating new components in packages/elements/src or when the user asks to add a new component to ai-elements.

AI Elements

AI Elements is a component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster. It provides pre-built components like conversations, messages and more.

Installing AI Elements is straightforward and can be done in a couple of ways. You can use the dedicated CLI command for the fastest setup, or integrate via the standard shadcn/ui CLI if you've already adopted shadcn's workflow.

Quick Start

Here are some basic examples of what you can achieve using components from AI Elements.

Prerequisites

Before installing AI Elements, make sure your environment meets the following requirements:

  • Node.js, version 18 or later
  • A Next.js project with the AI SDK installed.
  • shadcn/ui installed in your project. If you don't have it installed, running any install command will automatically install it for you.
  • We also highly recommend using the AI Gateway and adding AI_GATEWAY_API_KEY to your env.local so you don't have to use an API key from every provider. AI Gateway also gives $5 in usage per month so you can experiment with models. You can obtain an API key here.

Installing Components

You can install AI Elements components using either the AI Elements CLI or the shadcn/ui CLI. Both achieve the same result: adding the selected component’s code and any needed dependencies to your project.

The CLI will download the component’s code and integrate it into your project’s directory (usually under your components folder). By default, AI Elements components are added to the @/components/ai-elements/ directory (or whatever folder you’ve configured in your shadcn components settings).

After running the command, you should see a confirmation in your terminal that the files were added. You can then proceed to use the component in your code.

Usage

Once an AI Elements component is installed, you can import it and use it in your application like any other React component. The components are added as part of your codebase (not hidden in a library), so the usage feels very natural.

Example

After installing AI Elements components, you can use them in your application like any other React component. For example:

tsx
'use client';

import {
    Message,
    MessageContent,
    MessageResponse,
} from '@/components/ai-elements/message';
import { useChat } from '@ai-sdk/react';

const Example = () => {
    const { messages } = useChat();

    return (
        <>
            {messages.map(({ role, parts }, index) => (
                <Message from={role} key={index}>
                    <MessageContent>
                        {parts.map((part, i) => {
                            switch (part.type) {
                                case 'text':
                                    return (
                                        <MessageResponse key={`${role}-${i}`}>
                                            {part.text}
                                        </MessageResponse>
                                    );
                            }
                        })}
                    </MessageContent>
                </Message>
            ))}
        </>
    );
};

export default Example;

In the example above, we import the Message component from our AI Elements directory and include it in our JSX. Then, we compose the component with the MessageContent and MessageResponse subcomponents. You can style or configure the component just as you would if you wrote it yourself – since the code lives in your project, you can even open the component file to see how it works or make custom modifications.

Extensibility

All AI Elements components take as many primitive attributes as possible. For example, the Message component extends HTMLAttributes<HTMLDivElement>, so you can pass any props that a div supports. This makes it easy to extend the component with your own styles or functionality.

Show full SKILL.md (297 more words)Show less

Customization

After installation, no additional setup is needed. The component’s styles (Tailwind CSS classes) and scripts are already integrated. You can start interacting with the component in your app immediately.

For example, if you'd like to remove the rounding on Message, you can go to components/ai-elements/message.tsx and remove rounded-lg as follows:

tsx
export const MessageContent = ({
    children,
    className,
    ...props
}: MessageContentProps) => (
    <div
        className={cn(
            'flex flex-col gap-2 text-sm text-foreground',
            'group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4 group-[.is-user]:py-3',
            className,
        )}
        {...props}
    >
        <div className="is-user:dark">{children}</div>
    </div>
);

Troubleshooting

Why are my components not styled?

Make sure your project is configured correctly for shadcn/ui in Tailwind 4 - this means having a globals.css file that imports Tailwind and includes the shadcn/ui base styles.

I ran the AI Elements CLI but nothing was added to my project

Double-check that:

  • Your current working directory is the root of your project (where package.json lives).
  • Your components.json file (if using shadcn-style config) is set up correctly.
  • You’re using the latest version of the AI Elements CLI:
bash
npx ai-elements@latest

If all else fails, feel free to open an issue on GitHub.

Theme switching doesn’t work — my app stays in light mode

Ensure your app is using the same data-theme system that shadcn/ui and AI Elements expect. The default implementation toggles a data-theme attribute on the <html> element. Make sure your tailwind.config.js is using class or data- selectors accordingly:

The component imports fail with “module not found”

Check the file exists. If it does, make sure your tsconfig.json has a proper paths alias for @/ i.e.

json
{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "@/*": ["./*"]
        }
    }
}

My AI coding assistant can't access AI Elements components

  1. Verify your config file syntax is valid JSON.
  2. Check that the file path is correct for your AI tool.
  3. Restart your coding assistant after making changes.
  4. Ensure you have a stable internet connection.

Still stuck?

If none of these answers help, open an issue on GitHub and someone will be happy to assist.

Available Components

See the references/ folder for detailed documentation on each component.

© xiaoiver, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/ai-elements of xiaoiver/infinite-canvas-tutorial.

Open the folder on GitHubat commit 0238248

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in xiaoiver/infinite-canvas-tutorial, which our catalogue first saw on October 7, 2026.

Compare with similar skills

AI Elements next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AI Elements compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AI Elements this skillxiaoiver/infinite-canvas-tutorial1.1k2 repos~1.9kAutomated safety check: PassMIT
AI Elements Chat Componentsmweinbach/agent-coworker1565 repos~1.8kAutomated safety check: PassCustom licence
Nexus UIvictorcodess/nexus-ui132—~12kAutomated safety check: PassMIT
Web Artifacts Builderanthropics/skills180k40 repos~769Automated safety check: PassApache-2.0
UI StylingOhh-889/skyroc79513 repos~2.5kAutomated safety check: PassMIT
Shadcnsupabase/evals14342 repos~4.5kAutomated safety check: PassApache-2.0

Similar skills

  • AI Elements Chat Components

    mweinbach/agent-coworker

    Adds AI Elements components such as conversations, messages, tool displays and prompt inputs to a Next.js project that uses shadcn/ui.

    156 GitHub starsUsed in 5 repos~1.8k tokens
    Frontend & DesignAuto-check passed
  • Nexus UI

    victorcodess/nexus-ui

    Install and compose Nexus UI components for AI chat UIs — prompt input, model selector, suggestions, attachments, message, thread, citation, reasoning, text shimmer, image, feedback bar, toaster…

    132 GitHub stars~12k tokensUpdated 3 mo ago
    Research & ScienceAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 40 repos~769 tokens
    Frontend & DesignAuto-check passed
  • UI Styling

    Ohh-889/skyroc

    Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs.

    795 GitHub starsUsed in 13 repos~2.5k tokens
    Frontend & DesignAuto-check passed
  • Shadcn

    supabase/evals

    Official

    Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI.

    143 GitHub starsUsed in 42 repos~4.5k tokens
    Frontend & DesignAuto-check passed
  • Integrating shadcn/ui Components

    google-labs-code/stitch-skills

    Official

    Guides finding, installing, customizing and wiring up shadcn/ui components in a project, with MCP tools for the component catalog and registries.

    8.4k GitHub starsUsed in 4 repos~2.3k tokens
    Frontend & DesignAuto-check: notes

Questions about AI Elements

What does AI Elements do?

Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions. AI Elements is an agent skill from xiaoiver/infinite-canvas-tutorial. Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions.

When should I use AI Elements?

AI Elements fits situations like: creating new components in packages/elements/src; the user asks to add a new component to ai-elements.

How do I install AI Elements in Claude Code?

Run `npx skills add xiaoiver/infinite-canvas-tutorial --skill ai-elements -a claude-code`. Or copy the skill folder (.cursor/skills/ai-elements in xiaoiver/infinite-canvas-tutorial) into .claude/skills/ai-elements in your project. Claude Code loads it when a task matches its description.

How do I install AI Elements in Codex?

Run `npx skills add xiaoiver/infinite-canvas-tutorial --skill ai-elements -a codex`. Or copy the skill folder (.cursor/skills/ai-elements in xiaoiver/infinite-canvas-tutorial) into .agents/skills/ai-elements in your project. Codex loads it when a task matches its description.

Can I use AI Elements in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xiaoiver/infinite-canvas-tutorial --skill ai-elements -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ai-elements, .gemini/skills/ai-elements, .github/skills/ai-elements and .opencode/skills/ai-elements in your project.

What does AI Elements need to run?

Going by SKILL.md and its folder, AI Elements needs the command-line tools its instructions call (npx) and credentials named AI_GATEWAY_API_KEY. Our summary lists: Node.js; A credential in AI_GATEWAY_API_KEY.

Does AI Elements access the network?

SKILL.md names 7 domains. As links in the text: ui.shadcn.com, vercel.com, github.com, npmjs.com, nodejs.org, nextjs.org and ai-sdk.dev. This is read from the text; nothing was executed.

Is AI Elements safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does AI Elements use?

AI Elements is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AI Elements use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to AI Elements?

Skills that share tags, products or a category with AI Elements: AI Elements Chat Components (mweinbach/agent-coworker, 156 stars), Nexus UI (victorcodess/nexus-ui, 132 stars), Web Artifacts Builder (anthropics/skills, 180k stars) and UI Styling (Ohh-889/skyroc, 795 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AI Elements?

xiaoiver (a GitHub user) maintains it in xiaoiver/infinite-canvas-tutorial, which has 1,093 GitHub stars. The repository was last updated on October 7, 2026.

Source: xiaoiver/infinite-canvas-tutorial on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.