CodeCopyButton() — supabase Function Reference
Architecture documentation for the CodeCopyButton() function in CodeBlock.client.tsx from the supabase codebase.
Entity Profile
Relationship Graph
Source Code
apps/docs/features/ui/CodeBlock/CodeBlock.client.tsx lines 89–116
export function CodeCopyButton({ className, content }: { className?: string; content: string }) {
const [copied, setCopied] = useState(false)
const handleCopy = async () => {
copyToClipboard(content, () => {
setCopied(true)
setTimeout(() => setCopied(false), 1000)
})
}
return (
<button
onClick={handleCopy}
className={cn(
'border rounded-md p-1',
copied && 'bg-selection',
'hover:bg-selection transition',
className
)}
>
{copied ? (
<Check size={14} className="text-lighter" />
) : (
<Copy size={14} className="text-lighter" />
)}
</button>
)
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free