# Snippet
**Category**: react
**URL**: https://www.heroui.com/docs/react/migration/snippet
**Source**: https://raw.githubusercontent.com/heroui-inc/heroui/refs/heads/v3/apps/docs/content/docs/react/migration/(components)/snippet.mdx
> Migration guide for Snippet from HeroUI v2 to v3
***
The Snippet component has been **removed** in HeroUI v3. Use native HTML elements with Tailwind CSS classes and implement copy functionality manually using the Clipboard API.
## Key Changes
### 1. Component Removal
**v2:** `` component from `@heroui/react`
**v3:** Native HTML elements (`
`, ``) with manual copy implementation
### 2. Features Mapping
The v2 Snippet component had the following features that need to be replaced:
| v2 Feature | v3 Equivalent | Notes |
|-----------|---------------|-------|
| Copy button | Manual Button + Clipboard API | Use `navigator.clipboard.writeText()` |
| Copy tooltip | Tooltip component | Use v3 Tooltip component |
| Symbol prefix | Manual rendering | Add symbol as text content |
| Multi-line support | Array mapping | Map over array of strings |
| Variants (`flat`, `solid`, `bordered`, `shadow`) | Tailwind classes | Use background/border utilities |
| Colors (`default`, `primary`, etc.) | Tailwind classes | Use color utilities |
| Sizes (`sm`, `md`, `lg`) | Tailwind text sizes | Use `text-sm`, `text-base`, `text-lg` |
| Radius | Tailwind border radius | Use `rounded-*` classes |
## Structure Changes
In v2, `Snippet` was a component wrapper with built-in copy functionality:
```tsx
import { Snippet } from "@heroui/react";
export default function App() {
return (
npm install @heroui/react
);
}
```
In v3, use native HTML elements with manual copy implementation:
```tsx
import { Button, Tooltip } from "@heroui/react";
import { useState } from "react";
export default function App() {
const [copied, setCopied] = useState(false);
const handleCopy = async () => {
await navigator.clipboard.writeText("npm install @heroui/react");
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
return (