Skip to content
cccskills
FreePublished on GitHub

ai-elements

Build AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.

The English summary is being prepared. Showing the original description.

Works withVercel
See how to install

Files included (129)

  • SKILL.md7.1 KB
  • references/agent.md4.1 KB
  • references/artifact.md2.9 KB
  • references/attachments.md5.6 KB
  • references/audio-player.md5.2 KB
  • references/canvas.md1.1 KB
  • references/chain-of-thought.md3.3 KB
  • references/checkpoint.md5.5 KB
  • references/code-block.md5.4 KB
  • references/commit.md5.8 KB
  • references/confirmation.md8.6 KB
  • references/connection.md1.1 KB
  • references/context.md5.6 KB
  • references/controls.md971 B
  • references/conversation.md7.4 KB
  • references/edge.md2.1 KB
  • references/environment-variables.md3.7 KB
  • references/file-tree.md2.0 KB
  • references/image.md4.0 KB
  • references/inline-citation.md10.8 KB
  • references/jsx-preview.md3.2 KB
  • references/message.md9.4 KB
  • references/mic-selector.md7.7 KB
  • references/model-selector.md4.3 KB
  • references/node.md2.8 KB
  • references/open-in-chat.md2.7 KB
  • references/package-info.md3.2 KB
  • references/panel.md1.0 KB
  • references/persona.md5.4 KB
  • references/plan.md3.2 KB
  • references/prompt-input.md19.8 KB
  • references/queue.md5.4 KB
  • references/reasoning.md7.8 KB
  • references/sandbox.md4.3 KB
  • references/schema-display.md2.5 KB
  • references/shimmer.md1.6 KB
  • references/snippet.md2.2 KB
  • references/sources.md6.2 KB
  • references/speech-input.md6.5 KB
  • references/stack-trace.md7.9 KB
  • references/suggestion.md3.6 KB
  • references/task.md6.7 KB
  • references/terminal.md3.1 KB
  • references/test-results.md5.0 KB
  • references/tool.md8.5 KB
  • references/toolbar.md983 B
  • references/transcription.md4.9 KB
  • references/voice-selector.md10.3 KB
  • references/web-preview.md6.1 KB
  • scripts/agent.tsx1.6 KB
  • scripts/artifact.tsx2.9 KB
  • scripts/attachments-inline.tsx3.5 KB
  • scripts/attachments-list.tsx2.2 KB
  • scripts/attachments.tsx2.0 KB
  • scripts/audio-player-remote.tsx1.0 KB
  • scripts/audio-player.tsx1.8 KB
  • scripts/chain-of-thought.tsx138.6 KB
  • scripts/checkpoint.tsx2.8 KB
  • scripts/code-block-dark.tsx1.0 KB
  • scripts/code-block.tsx2.9 KB
  • scripts/commit.tsx2.1 KB
  • scripts/confirmation-accepted.tsx1.2 KB
  • scripts/confirmation-rejected.tsx1.1 KB
  • scripts/confirmation-request.tsx1.7 KB
  • scripts/confirmation.tsx1.7 KB
  • scripts/context.tsx1005 B
  • scripts/conversation.tsx4.1 KB
  • scripts/environment-variables.tsx1.7 KB
  • scripts/file-tree-basic.tsx380 B
  • scripts/file-tree-expanded.tsx609 B
  • scripts/file-tree-selection.tsx619 B
  • scripts/file-tree.tsx1.5 KB
  • scripts/image.tsx136.5 KB
  • scripts/inline-citation.tsx3.2 KB
  • scripts/jsx-preview.tsx3.2 KB
  • scripts/message.tsx10.1 KB
  • scripts/mic-selector.tsx1.2 KB
  • scripts/model-selector.tsx8.5 KB
  • scripts/open-in-chat.tsx704 B
  • scripts/package-info.tsx1.3 KB
  • scripts/persona-command.tsx2.5 KB
  • scripts/persona-glint.tsx2.5 KB
  • scripts/persona-halo.tsx2.5 KB
  • scripts/persona-mana.tsx2.5 KB
  • scripts/persona-obsidian.tsx2.5 KB
  • scripts/persona-opal.tsx2.5 KB
  • scripts/plan.tsx1.9 KB
  • scripts/prompt-input-cursor.tsx15.1 KB
  • scripts/prompt-input-tooltip.tsx1.1 KB
  • scripts/prompt-input.tsx7.4 KB
  • scripts/queue-prompt-input.tsx10.5 KB
  • scripts/queue.tsx8.0 KB
  • scripts/reasoning.tsx2.2 KB
  • scripts/sandbox.tsx5.4 KB
  • scripts/schema-display-basic.tsx221 B
  • scripts/schema-display-body.tsx487 B
  • scripts/schema-display-nested.tsx470 B
  • scripts/schema-display-params.tsx374 B
  • scripts/schema-display.tsx2.7 KB
  • scripts/shimmer-duration.tsx934 B
  • scripts/shimmer-elements.tsx1.1 KB
  • scripts/shimmer.tsx443 B
  • scripts/snippet-plain.tsx362 B
  • scripts/snippet.tsx589 B
  • scripts/sources-custom.tsx1.0 KB
  • scripts/sources.tsx752 B
  • scripts/speech-input.tsx2.3 KB
  • scripts/stack-trace-collapsed.tsx1.1 KB
  • scripts/stack-trace-no-internal.tsx1.2 KB
  • scripts/stack-trace.tsx1.9 KB
  • scripts/suggestion-input.tsx4.4 KB
  • scripts/suggestion.tsx802 B
  • scripts/task.tsx1.5 KB
  • scripts/terminal-basic.tsx169 B
  • scripts/terminal-clear.tsx523 B
  • scripts/terminal-streaming.tsx1007 B
  • scripts/terminal.tsx2.3 KB
  • scripts/test-results-basic.tsx464 B
  • scripts/test-results-errors.tsx1.3 KB
  • scripts/test-results-suites.tsx901 B
  • scripts/test-results.tsx2.7 KB
  • scripts/tool-input-available.tsx738 B
  • scripts/tool-input-streaming.tsx683 B
  • scripts/tool-output-available.tsx1.7 KB
  • scripts/tool-output-error.tsx1.1 KB
  • scripts/tool.tsx6.7 KB
  • scripts/transcription.tsx4.9 KB
  • scripts/voice-selector.tsx7.1 KB
  • scripts/web-preview.tsx2.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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.

IMPORTANT: Run all CLI commands using the project's package runner: npx ai-elements@latest, pnpm dlx ai-elements@latest, or bunx --bun ai-elements@latest — based on the project's packageManager. Examples below use npx ai-elements@latest but substitute the correct runner for the project.

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:

"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.

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:

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:
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.

{
  "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.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

The English summary is being prepared. Showing the original description.

mxyhi/ok-skills498Updated Oct 18, 2026

Autonomous iteration loop: modify, verify, keep/discard against any metric

The English summary is being prepared. Showing the original description.

mxyhi/ok-skills498Updated Oct 18, 2026

ax

Free

Use the ax CLI instead of curl + throwaway parsing scripts whenever you fetch a URL, explore an unknown web page, or extract structured data from HTML. Trigger whenever you are about to write an inline script (python3 heredoc, node -e, regex over HTML) or a bare curl for one-off web fetching, scraping, or page exploration.

The English summary is being prepared. Showing the original description.

mxyhi/ok-skills498Updated Oct 18, 2026

Use when working with icons in any project. Provides CLI for searching 200+ icon libraries (Iconify) and retrieving SVGs. Commands: `better-icons search <query>` to find icons, `better-icons get <id>` to get SVG. Also available as MCP server for AI agents.

The English summary is being prepared. Showing the original description.

mxyhi/ok-skills498Updated Oct 18, 2026

Detect and recover text that was accidentally typed with the Taiwanese Bopomofo / Zhuyin (注音) keyboard while the input method (IME) was stuck in English/ASCII mode — what Taiwanese users call 注音亂碼 or 注音文 — producing meaningless-looking letter+digit sequences such as "su3cl3a8", "cl3", "g4", "2k7", "vu,4", or such garbled runs embedded in an otherwise normal request (e.g. "help me fix su3cl3a8", "看看這個 PR qk4ru.6", "幫我改 su3cl3a8xk7"). Use this skill whenever a user message contains short ASCII tokens that look like keyboard gibberish, do not form real English words, and cannot be understood normally — especially tokens with digits interspersed among letters (tone keys 3/4/6/7 or vowel keys 8/9/0), which are a strong sign of Mandarin phonetic keystrokes typed in the wrong input mode. Run scripts/decode_bopomofo.py to deterministically map the keystrokes back to 注音 symbols with a confidence score, then interpret the intended Traditional Chinese in context and continue the user's original request without making them retype. Do NOT trigger on genuine technical strings — code, file paths, URLs, git hashes, CLI flags, package names, version numbers — the script's exclusion rules and confidence tiers already filter these out. Especially valuable for Taiwanese developers who forget to switch input methods when prompting AI coding agents.

The English summary is being prepared. Showing the original description.

mxyhi/ok-skills498Updated Oct 18, 2026

Capture a full DevTools-protocol trace of any browser automation — CDP firehose, screenshots, and DOM dumps — then bisect the stream into per-page searchable buckets. Use when the user wants to debug a failed run, audit network/console/DOM activity, attach a trace to an in-progress session, or feed structured per-page summaries back into an agent loop so its next iteration learns from the last one.

The English summary is being prepared. Showing the original description.

mxyhi/ok-skills498Updated Oct 18, 2026

See all skills by mxyhi

Report a problem with this skill