Agent skill

Agent Elements

by 21st-dev in 21st-dev/agent-elements

A skill your agent uses whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from…

MITAuto-check passedFrontend & Design

Install Agent Elements

skills CLI
$ npx skills add 21st-dev/agent-elements --skill agent-elements -a claude-code

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

GitHub CLI
$ gh skill install 21st-dev/agent-elements agent-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/21st-dev/agent-elements.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agent-elements .claude/skills/agent-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
agent-elements
GitHub stars
104
Used in
1 other repo
Token cost
~2.3k tokens
SKILL.md length
668 words
Files
2
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from…

  • Works in 4 steps: The registry is shadcn-compatible. Every… → The API is typed around the Vercel AI… → The full component catalog with API… → …
  • The user wants to build
  • SKILL.md covers What this skill gives you, Detection, Paths (post-install layout) and Component catalog, plus 5 more sections
  • Calls npx; reaches agent-elements.21st.dev

What it does

Agent Elements is an agent skill from 21st-dev/agent-elements. Use whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from @/components/agent-elements/ or the project has that folder on disk. Triggers: "agent chat", "tool call UI", "streaming chat", "plan approval", "AgentChat", "InputBar", "tool renderer", mentions of Agent Elements, or requests to add a new agent surface with shadcn. Do NOT use for plain chat UIs that don't need tool/plan/approval cards, or for projects already…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).

It sits in Frontend & Design, covering Design systems and Structured output and tool calling. It works with shadcn/ui, React and Tailwind CSS. The licence is MIT.

When your agent uses it

  • The user wants to build
  • Tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from @/components/agent-elements/
  • The project has that folder on disk
  • Plain chat UIs that dont need tool/plan/approval cards

Example prompts

  • “agent chat”
  • “tool call UI”
  • “streaming chat”
  • “/agent-elements”

Requirements

  • Node.js

Workflow steps

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

  1. The registry is shadcn-compatible. Every component is installed with
  2. The API is typed around the Vercel AI SDK. Messages are
  3. The full component catalog with API shapes and composition rules (see
  4. Theming guardrails — the Tailwind tokens Agent Elements depends on.

What it can do on your machine

Read from SKILL.md and the folder at commit b04b36c. 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

    Hosts in commands or code, which the agent is likely to contact:

    • agent-elements.21st.dev

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Agent Elements loads about 2.3k tokens when it runs. Until then it costs about 144 tokens; SKILL.md has 668 words of instructions outside code blocks.

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

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 21st-dev/agent-elements at commit b04b36c, republished under its MIT licence (© 21st-dev). 668 words, ~2,343 tokens.

Download SKILL.mdSave it as .claude/skills/agent-elements/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
agent-elements
description
Use whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from `@/components/agent-elements/*` or the project has that folder on disk. Triggers: "agent chat", "tool call UI", "streaming chat", "plan approval", "AgentChat", "InputBar", "tool renderer", mentions of Agent Elements, or requests to add a new agent surface with shadcn. Do NOT use for plain chat UIs that don't need tool/plan/approval cards, or for projects already committed to a different agent UI kit.

Agent Elements skill

Project-aware context for building chat and agent UIs with Agent Elements — an open-source shadcn registry at https://agent-elements.21st.dev.

What this skill gives you

When this skill loads, you know:

  1. The registry is shadcn-compatible. Every component is installed with npx shadcn@latest add https://agent-elements.21st.dev/r/<component>.json. Files land under components/agent-elements/ (the library's internal components/ prefix is stripped — see Paths below).
  2. The API is typed around the Vercel AI SDK. Messages are UIMessage[] from ai, status is ChatStatus. useChat() plugs in directly.
  3. The full component catalog with API shapes and composition rules (see sections below).
  4. Theming guardrails — the Tailwind tokens Agent Elements depends on.

Detection

Consider this project "Agent Elements-ready" if any of these are true:

  • components/agent-elements/ exists on disk
  • components.json includes an alias or registry reference to Agent Elements
  • package.json dependencies include ai + @tabler/icons-react and the user mentions Agent Elements

If the folder does not exist yet, install on demand with:

bash
npx shadcn@latest add https://agent-elements.21st.dev/r/agent-chat.json

agent-chat transitively pulls every other component it needs via registryDependencies (MessageList, InputBar, tool renderers, shared utils).

Paths (post-install layout)

After shadcn add, files sit under @/components/agent-elements/ with this shape:

components/agent-elements/
  agent-chat.tsx
  message-list.tsx
  input-bar.tsx
  markdown.tsx
  user-message.tsx
  error-message.tsx
  text-shimmer.tsx
  spiral-loader.tsx
  input/
    attachment-button.tsx
    send-button.tsx
    file-attachment.tsx
    suggestions.tsx
    model-picker.tsx
    mode-selector.tsx
  tools/
    bash-tool.tsx
    edit-tool.tsx
    search-tool.tsx
    todo-tool.tsx
    plan-tool.tsx
    tool-group.tsx
    subagent-tool.tsx
    mcp-tool.tsx
    thinking-tool.tsx
    generic-tool.tsx
  question/
    question-tool.tsx
  hooks/use-tool-complete.ts
  utils/cn.ts
  types.ts

Import rule: always import from the exact file, never from a barrel.

tsx
// ✅
import { AgentChat } from "@/components/agent-elements/agent-chat";
import { BashTool } from "@/components/agent-elements/tools/bash-tool";

// ❌ — no barrel exists
import { AgentChat } from "@/components/agent-elements";

Component catalog

Chat surface
  • AgentChat — the full chat shell. Renders MessageList + InputBar, handles tool invocations via toolRenderers, shows an empty state with optional suggestions. Props: messages, status, onSend, onStop, toolRenderers?, suggestions?, attachments?, classNames?, slots?.
  • MessageList — transcript only. Use when you need the input bar somewhere else. Accepts toolRenderers and showCopyToolbar.
  • UserMessage / ErrorMessage / Markdown — low-level message pieces. Markdown streams safely (external links get rel="noreferrer" by default).
Input
  • InputBar — composer. Props: status, onSend({ content }), onStop, value? + onChange? (controlled), attachedImages/attachedFiles with their remove handlers, leftActions/rightActions slots, suggestions?, questionBar?, infoBar?.
  • Suggestions — quick-prompt chips for the empty state or inline.
  • ModelPicker / ModeSelector — designed to drop into leftActions. Both accept a simple { id, name, version? } / { id, label, icon?, description? } shape. Do not import CLAUDE_MODELS — it was removed; supply your own array.
  • SendButton / AttachmentButton / FileAttachment — usable standalone if you're building a custom composer.
Tool cards

All tool cards accept a part prop of type Extract<UIMessage["parts"][number], { type: \tool-<Name>` }>from the AI SDK. Register them viatoolRenderersonAgentChat/MessageList`:

tsx
<AgentChat
  toolRenderers={{
    Bash: BashTool,
    Edit: EditTool,
    Write: EditTool,      // Write reuses EditTool
    Search: SearchTool,
    WebSearch: SearchTool,
    TodoWrite: TodoTool,
    PlanWrite: PlanTool,
    Task: SubagentTool,
    Thinking: ThinkingTool,
  }}
/>

Cards available:

  • BashTool — command + stdout, collapsible.
  • EditTool — diff card. Supports input.old_string/input.new_string or output.structuredPatch, plus an approval footer via input.approval.
  • SearchTool — grouped search results. Pass results or use output.results.
  • TodoTool — diffed todo list from input.todos vs output.oldTodos.
  • PlanTool — plan title + summary with approve/reject footer.
  • ToolGroup — collapses consecutive tool calls into one row.
  • SubagentTool — sub-agent task with nested tools.
  • McpTool — generic MCP tool output; use parseMcpToolType from @/components/agent-elements/tools/tool-registry to get mcpInfo.
  • ThinkingTool — collapsible reasoning row.
  • GenericTool — fallback for unknown tools.
  • QuestionTool — clarifying question with single/multi/text answer kinds.
Show full SKILL.md (229 more words)Show less
Streaming states
  • TextShimmer — shimmering status label.
  • SpiralLoader — Lottie spiral; use for multi-second loading states.

Composition patterns

Full chat with tool rendering (most common)
tsx
"use client";

import { AgentChat } from "@/components/agent-elements/agent-chat";
import { BashTool } from "@/components/agent-elements/tools/bash-tool";
import { EditTool } from "@/components/agent-elements/tools/edit-tool";
import { SearchTool } from "@/components/agent-elements/tools/search-tool";
import { useChat } from "@ai-sdk/react";

export default function Chat() {
  const { messages, status, sendMessage, stop } = useChat();
  return (
    <AgentChat
      messages={messages}
      status={status}
      onSend={({ content }) => sendMessage({ text: content })}
      onStop={stop}
      toolRenderers={{
        Bash: BashTool,
        Edit: EditTool,
        Write: EditTool,
        Search: SearchTool,
      }}
    />
  );
}
Composer with mode + model pickers
tsx
import { InputBar } from "@/components/agent-elements/input-bar";
import { ModeSelector } from "@/components/agent-elements/input/mode-selector";
import { ModelPicker } from "@/components/agent-elements/input/model-picker";
import { IconBulb, IconCursor } from "@tabler/icons-react";

const modes = [
  { id: "agent", label: "Agent", icon: IconCursor },
  { id: "plan", label: "Plan", icon: IconBulb },
];
const models = [
  { id: "sonnet", name: "Sonnet", version: "4.6" },
  { id: "opus", name: "Opus", version: "4.7" },
];

<InputBar
  status="ready"
  onSend={handleSend}
  onStop={handleStop}
  leftActions={
    <>
      <ModeSelector modes={modes} defaultValue="agent" />
      <ModelPicker models={models} defaultValue="sonnet" />
    </>
  }
/>
Custom tool renderer

toolRenderers values are React components that receive { part, chatStatus }. Return whatever UI you want; reuse GenericTool as a fallback shell.

Theming

Agent Elements reads these Tailwind CSS vars (shadcn-style). Do not remove or rename them in the consumer theme:

  • --an-foreground, --an-background, --an-primary-color
  • Standard shadcn tokens: --background, --foreground, --border, --muted, --muted-foreground, --accent, --primary, etc.

Customising a component is just editing the installed file. Prefer that over wrapping — the code is yours now.

When NOT to use Agent Elements

  • Projects using assistant-ui, ai-elements, copilotkit, or another kit — don't mix.
  • Pure chat UIs that never render tool calls or plans — InputBar + your own message rendering may be enough; skip AgentChat.
  • React < 19 or Tailwind < v4 — the components depend on both.

Quick answers for common asks

  • "Add Agent Elements to this project" → run npx shadcn@latest init if components.json is missing, then npx shadcn@latest add https://agent-elements.21st.dev/r/agent-chat.json.
  • "Switch the default SendButton look" → edit components/agent-elements/input/send-button.tsx directly. Tokens live on --an-* CSS vars.
  • "Render a custom tool" → map its type in toolRenderers; fall back to GenericTool for unknown tools.
  • "Use with useChat" → pass messages and status straight through, translate sendMessage/stop to onSend({ content })/onStop.

Registry reference

  • Index: https://agent-elements.21st.dev/r/index.json
  • Per-component: https://agent-elements.21st.dev/r/<id>.json
  • Full docs in one file: https://agent-elements.21st.dev/llms-full.txt

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

Files

SKILL.md and 1 other file in skills/agent-elements of 21st-dev/agent-elements.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit b04b36c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in 21st-dev/agent-elements, which our catalogue first saw on October 7, 2026.

Compare with similar skills

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

Agent Elements compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Elements this skill21st-dev/agent-elements1041 repos~2.3kAutomated safety check: PassMIT
Creative Tim UI Blockscreativetimofficial/ui12k—~2.1kAutomated safety check: NotesMIT
Cosscrafter-station/petdex4.2k—~1.4kAutomated safety check: PassMIT
Ss Learnbitjaru/styleseed970—~1.3kAutomated safety check: PassMIT
UithingBayBreezy/ui-thing729—~1.3kAutomated safety check: PassCustom licence
Animated React Component LibrariesHainrixz/editor-pro-max2601 repos~5.7kAutomated safety check: PassCustom licence

Similar skills

  • Creative Tim UI Blocks

    creativetimofficial/ui

    Helps install, generate and review Creative Tim UI blocks: shadcn/ui-based React and Tailwind sections that follow a restrained, production-minded design philosophy.

    12k GitHub stars~2.1k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check: notes
  • Coss

    crafter-station/petdex

    Helps implement coss UI components correctly. An agent skill from crafter-station/petdex.

    4.2k GitHub stars~1.4k tokensUpdated 8 days ago
    Frontend & DesignAuto-check passed
  • Ss Learn

    bitjaru/styleseed

    Capture a human-approved UI design lesson as a privacy-minimized local StyleSeed candidate, review it, and prepare an opt-in share package without transmitting project code, prompts, screenshots, or…

    970 GitHub stars~1.3k tokensUpdated 6 days ago
    Frontend & DesignAuto-check passed
  • Uithing

    BayBreezy/ui-thing

    Manages UI Thing components, prose, blocks, themes, shortcuts, docs, and MCP-driven workflows in Nuxt projects and in the UI Thing source repo.

    729 GitHub stars~1.3k tokensUpdated 5 days ago
    Frontend & DesignAuto-check passed
  • Animated React Component Libraries

    Hainrixz/editor-pro-max

    Helps choose and drop in animated React components from Magic UI and React Bits for landing pages, marketing sites and dashboards, instead of hand-coding animations.

    260 GitHub starsUsed in 1 repo~5.7k tokens
    Frontend & DesignAuto-check passed
  • Extract Design

    Manavarya09/design-extract

    Extract the full design language from any website URL. An agent skill from Manavarya09/design-extract.

    4.2k GitHub stars~786 tokensUpdated 8 days ago
    Frontend & DesignAuto-check: notes

Questions about Agent Elements

What does Agent Elements do?

A skill your agent uses whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from…. Agent Elements is an agent skill from 21st-dev/agent-elements. Use whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from @/components/agent-elements/ or the project has that folder on disk.

When should I use Agent Elements?

Agent Elements fits situations like: the user wants to build; tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from @/components/agent-elements/; the project has that folder on disk; plain chat UIs that dont need tool/plan/approval cards.

How do I install Agent Elements in Claude Code?

Run `npx skills add 21st-dev/agent-elements --skill agent-elements -a claude-code`. Or copy the skill folder (skills/agent-elements in 21st-dev/agent-elements) into .claude/skills/agent-elements in your project. Claude Code loads it when a task matches its description.

How do I install Agent Elements in Codex?

Run `npx skills add 21st-dev/agent-elements --skill agent-elements -a codex`. Or copy the skill folder (skills/agent-elements in 21st-dev/agent-elements) into .agents/skills/agent-elements in your project. Codex loads it when a task matches its description.

Can I use Agent 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 21st-dev/agent-elements --skill agent-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/agent-elements, .gemini/skills/agent-elements, .github/skills/agent-elements and .opencode/skills/agent-elements in your project.

What does Agent Elements need to run?

Going by SKILL.md and its folder, Agent Elements needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Agent Elements access the network?

SKILL.md names 1 domain. In commands or code: agent-elements.21st.dev; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Agent 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 Agent Elements use?

Agent 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 Agent Elements use?

About 2.3k tokens (SKILL.md is roughly 9.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 Agent Elements?

Skills that share tags, products or a category with Agent Elements: Creative Tim UI Blocks (creativetimofficial/ui, 12k stars), Coss (crafter-station/petdex, 4.2k stars), Ss Learn (bitjaru/styleseed, 970 stars) and Uithing (BayBreezy/ui-thing, 729 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Elements?

21st-dev (a GitHub organization) maintains it in 21st-dev/agent-elements, which has 104 GitHub stars. The repository was last updated on April 24, 2026.

Source: 21st-dev/agent-elements on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.