laguagu/claude-code-nextjs-skills / skills/ai-elements
ai-elements
VerifiedMaintains AI chat UI built from elements.ai-sdk.dev AI Elements components already copied into the project. Use when changing or debugging those components (conversations, messages, prompt inputs, attachments, reasoning, tool output, sources). New chat UI uses the shadcn/ui AI Elements patterns (`shadcn` skill).
scripts/terminal.tsx
View on GitHub"use client";
import {
Terminal,
TerminalActions,
TerminalClearButton,
TerminalContent,
TerminalCopyButton,
TerminalHeader,
TerminalStatus,
TerminalTitle,
} from "@/components/ai-elements/terminal";
import { useCallback, useEffect, useState } from "react";
const handleTerminalCopy = () => {
console.log("Copied!");
};
const ansiOutput = `\u001B[32m✓\u001B[0m Compiled successfully in 1.2s
\u001B[1m\u001B[34minfo\u001B[0m - Collecting page data...
\u001B[1m\u001B[34minfo\u001B[0m - Generating static pages (0/3)
\u001B[32m✓\u001B[0m Generated static pages (3/3)
\u001B[1m\u001B[33mwarn\u001B[0m - Using \u001B[1mexperimental\u001B[0m server actions
\u001B[36mRoute (app)\u001B[0m \u001B[36mSize\u001B[0m \u001B[36mFirst Load JS\u001B[0m
\u001B[37m┌ ○ /\u001B[0m \u001B[32m5.2 kB\u001B[0m \u001B[32m87.3 kB\u001B[0m
\u001B[37m├ ○ /about\u001B[0m \u001B[32m2.1 kB\u001B[0m \u001B[32m84.2 kB\u001B[0m
\u001B[37m└ ○ /contact\u001B[0m \u001B[32m3.8 kB\u001B[0m \u001B[32m85.9 kB\u001B[0m
\u001B[32m✓\u001B[0m Build completed successfully!
\u001B[90mTotal time: 3.45s\u001B[0m
`;
const Example = () => {
const [output, setOutput] = useState("");
const [isStreaming, setIsStreaming] = useState(true);
useEffect(() => {
let index = 0;
const interval = setInterval(() => {
if (index < ansiOutput.length) {
setOutput(ansiOutput.slice(0, index + 10));
index += 10;
} else {
setIsStreaming(false);
clearInterval(interval);
}
}, 20);
return () => clearInterval(interval);
}, []);
const handleClear = useCallback(() => {
setOutput("");
setIsStreaming(false);
}, []);
return (
<Terminal
autoScroll={true}
isStreaming={isStreaming}
onClear={handleClear}
output={output}
>
<TerminalHeader>
<TerminalTitle>Build Output</TerminalTitle>
<div className="flex items-center gap-1">
<TerminalStatus />
<TerminalActions>
<TerminalCopyButton onCopy={handleTerminalCopy} />
<TerminalClearButton />
</TerminalActions>
</div>
</TerminalHeader>
<TerminalContent />
</Terminal>
);
};
export default Example;
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |