aktonay/skillz / skills/design/react-bits
react-bits
VerifiedOver 215+ animated, interactive, copy-paste React micro-components and effects (text animations, interactive backgrounds, physics cards, custom cursors, blobs, and dock bars).
src/components/code/Dependencies.jsx
View on GitHubimport { useEffect, useMemo, useState } from 'react';
import { Check, Copy } from 'lucide-react';
import { useInstallation } from '../../hooks/useInstallation';
const INSTALL_COMMANDS = {
npm: 'npm install',
pnpm: 'pnpm add',
yarn: 'yarn add',
bun: 'bun add'
};
const Dependencies = ({ dependencyList = [] }) => {
const { packageManager } = useInstallation();
const [copied, setCopied] = useState(false);
const dependencies = useMemo(
() => [...new Set(dependencyList.map(dependency => dependency.trim()).filter(Boolean))],
[dependencyList]
);
const command = `${INSTALL_COMMANDS[packageManager] || INSTALL_COMMANDS.npm} ${dependencies.join(' ')}`;
useEffect(() => {
if (!copied) return undefined;
const timeout = window.setTimeout(() => setCopied(false), 1800);
return () => window.clearTimeout(timeout);
}, [copied]);
if (dependencies.length === 0) return null;
const copyCommand = async () => {
try {
await navigator.clipboard.writeText(command);
setCopied(true);
} catch {
setCopied(false);
}
};
return (
<section className="dependencies-panel" aria-labelledby="dependencies-title">
<div className="dependencies-summary">
<h2 id="dependencies-title">Dependencies</h2>
<p>
{dependencies.length} required {dependencies.length === 1 ? 'package' : 'packages'}
</p>
</div>
<div className="dependencies-command">
<code title={command}>{command}</code>
<button type="button" onClick={copyCommand} aria-label={copied ? 'Install command copied' : 'Copy install command'}>
{copied ? <Check size={15} aria-hidden="true" /> : <Copy size={15} aria-hidden="true" />}
<span aria-live="polite">{copied ? 'Copied' : 'Copy'}</span>
</button>
</div>
</section>
);
};
export default Dependencies;
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: 319k | 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: 196k | 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: 196k | 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: 196k | Updated | Claude CodeCodex | Verified | Install |