Installation
Add snippets to your project with the shadcn CLI or by copying them.
With the shadcn CLI
Every JavaScript and TypeScript snippet is published as a shadcn registry item. Pass its URL to shadcn add:
npx shadcn@latest add https://quicksnip.dev/r/debounce.jsonThe file is copied into your lib folder (for example lib/debounce.ts or src/lib/debounce.ts), and you import it like any other module:
import { debounce } from "@/lib/debounce";You can install several at once:
npx shadcn@latest add https://quicksnip.dev/r/slugify.json https://quicksnip.dev/r/retry.jsonThe CLI needs a
components.jsonin your project. If you already use shadcn/ui, you have one. If not, runnpx shadcn@latest initonce.
Shorter names (optional)
Add QuickSnip as a namespaced registry in components.json:
{
"registries": {
"@quicksnip": "https://quicksnip.dev/r/{name}.json"
}
}Then install by name:
npx shadcn@latest add @quicksnip/debounceCopy & paste
Every snippet page on /snippets has a copy button for each language. Paste the code where you need it. That's it.
Finding a snippet's name
The name is shown at the bottom of each snippet page (for example kebab-case). It's usually the snippet's folder name. If two categories have a snippet with the same name, the category is added in front, like algorithm-binary-search.
The full list is in llms.txt and the registry index.