Skip to content

Commit ea01da0

Browse files
hariclaude
andauthored
setup shadcn registry (#431)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b35730d commit ea01da0

174 files changed

Lines changed: 1798 additions & 78 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_APP_URL=https://animata.design

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,9 @@ next-env.d.ts
3939

4040
*storybook.log
4141
public/preview
42+
public/r
43+
public/docs
44+
public/llms.txt
45+
public/llms-full.txt
4246
_internal/
4347
.superset/

components/mdx-components.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { CopyProxy } from "@/components/copy-proxy";
2626
import { AnimataRenderer } from "@/components/dynamic-animata";
2727
import { FrameworkDocs } from "@/components/framework-docs";
2828
import PreviewContainer from "@/components/preview-container";
29+
import { RegistryInstall } from "@/components/registry-install";
2930
import {
3031
Accordion,
3132
AccordionContent,
@@ -199,6 +200,7 @@ const components = {
199200
ComponentPreview,
200201
ComponentExample,
201202
ComponentSource,
203+
RegistryInstall,
202204
AspectRatio,
203205
CodeBlockWrapper: ({ ...props }) => <CodeBlockWrapper className="rounded-md border" {...props} />,
204206
Step: ({ className, ...props }: ComponentProps<"h3">) => (

components/registry-install.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"use client";
2+
3+
import { CopyNpmCommandButton } from "@/components/copy-button";
4+
import { siteConfig } from "@/config/site";
5+
import { cn } from "@/lib/utils";
6+
7+
type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
8+
9+
const REGISTRY_BASE_URL = (process.env.NEXT_PUBLIC_APP_URL || siteConfig.url).replace(/\/$/, "");
10+
11+
interface RegistryInstallProps {
12+
category: string;
13+
name: string;
14+
className?: string;
15+
}
16+
17+
export function RegistryInstall({ category, name, className }: RegistryInstallProps) {
18+
const url = `${REGISTRY_BASE_URL}/r/${category}/${name}.json`;
19+
const commands: Record<PackageManager, string> = {
20+
pnpm: `pnpm dlx shadcn@latest add ${url}`,
21+
npm: `npx shadcn@latest add ${url}`,
22+
yarn: `yarn dlx shadcn@latest add ${url}`,
23+
bun: `bunx shadcn@latest add ${url}`,
24+
};
25+
26+
return (
27+
<pre
28+
className={cn(
29+
"w-full grid grid-cols-[1fr_auto] mt-4 rounded-lg bg-zinc-800 p-4 [&_code]:bg-transparent",
30+
className,
31+
)}
32+
>
33+
<code
34+
className={cn(
35+
"relative rounded max-w-full overflow-x-auto bg-zinc-800 px-2 py-[0.2rem] font-mono text-sm text-white",
36+
className,
37+
)}
38+
>
39+
{commands.pnpm}
40+
</code>
41+
42+
<CopyNpmCommandButton
43+
commands={{
44+
__npmCommand__: commands.npm,
45+
__yarnCommand__: commands.yarn,
46+
__pnpmCommand__: commands.pnpm,
47+
__bunCommand__: commands.bun,
48+
}}
49+
/>
50+
</pre>
51+
);
52+
}

content/docs/accordion/faq.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ published: false
99

1010
## Installation
1111

12+
### CLI
13+
14+
<RegistryInstall category="accordion" name="faq" />
15+
16+
### Manual
17+
1218
<Steps>
1319
<Step>Install dependencies</Step>
1420

1521
```bash
16-
npm install framer-motion lucide-react
22+
npm install motion lucide-react
1723
```
1824

1925
<Step>Run the following command</Step>

content/docs/background/animated-beam.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ author: harimanok_
88

99
## Installation
1010

11+
### CLI
12+
13+
<RegistryInstall category="background" name="animated-beam" />
14+
15+
### Manual
16+
1117
<Steps>
1218

1319
<Step>Add to your CSS</Step>

content/docs/background/blurry-blob.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ author: ll4xmii
88

99
## Installation
1010

11+
### CLI
12+
13+
<RegistryInstall category="background" name="blurry-blob" />
14+
15+
### Manual
16+
1117
<Steps>
1218
<Step>Add to your CSS</Step>
1319
```css

content/docs/background/diagonal-lines.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ author: harimanok_
88

99
## Installation
1010

11+
### CLI
12+
13+
<RegistryInstall category="background" name="diagonal-lines" />
14+
15+
### Manual
16+
1117
<Steps>
1218
<Step>Run the following command</Step>
1319

content/docs/background/dot.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ author: harimanok_
88

99
## Installation
1010

11+
### CLI
12+
13+
<RegistryInstall category="background" name="dot" />
14+
15+
### Manual
16+
1117
<Steps>
1218
<Step>Run the following command</Step>
1319

content/docs/background/grid.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ author: harimanok_
88

99
## Installation
1010

11+
### CLI
12+
13+
<RegistryInstall category="background" name="grid" />
14+
15+
### Manual
16+
1117
<Steps>
1218
<Step>Run the following command</Step>
1319

0 commit comments

Comments
 (0)