BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/aurora/aurora-ai-snippet

Aurora AI Snippet

aurora-dinglebear-ai/aurora-ai-snippet
FreeBlock

Aurora-native snippet parity surface from AI Elements.

Install it

npx shadcn@latest add https://aurora.dinglebear.ai/r/aurora-ai-snippet.json

Source

registry/aurora/blocks/ai/elements/snippet.tsxaurora.dinglebear.ai/r/aurora-ai-snippet.json
1"use client"
2
3import * as React from "react"
4import { Check, CodeXml, Copy } from "lucide-react"
5import { Badge } from "@/registry/aurora/ui/badge"
6import { Button } from "@/registry/aurora/ui/button"
7import { useClipboard } from "@/registry/aurora/lib/use-clipboard"
8
9export interface SnippetProps extends React.HTMLAttributes<HTMLPreElement> {
10 code: string
11 /** Short language identifier shown in the header chip (e.g. "ts", "tsx", "py"). */
12 language?: string
13}
14
15/**
16 * Lightweight token highlighter that reproduces the Claude Design Snippet
17 * coloring: keywords in rose, member/function calls in cyan, numbers in orange,
18 * strings in success-teal, everything else in primary text. Deliberately simple
19 * (no external grammar) so it stays in sync with the registry token palette.
20 */
21const KEYWORDS = new Set([
22 "export",
23 "import",
24 "from",
25 "default",
26 "const",
27 "let",
28 "var",
29 "function",
30 "async",
31 "await",
32 "return",
33 "if",
34 "else",
35 "for",
36 "while",
37 "new",
38 "class",
39 "extends",
40 "typeof",
41 "in",
42 "of",
43 "yield",
44 "try",
45 "catch",
46 "finally",
47 "throw",
48 "def",
49 "lambda",
50 "true",
51 "false",
52 "null",
53 "undefined",
54 "None",
55 "True",
56 "False",
57])
58
59const TOKEN_RE =
60 /(\/\/[^\n]*|#[^\n]*)|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`)|(\b\d[\d_.]*\b)|([A-Za-z_$][\w$]*)|(\s+)|([^\s\w$])/g
61
62function tokenColor(word: string, prevSig: string, nextSig: string): string | undefined {
63 if (KEYWORDS.has(word)) return "var(--aurora-accent-pink)"
64 // member access (foo.bar) or call (bar(...)) → cyan identifier
65 if (prevSig === "." || nextSig === "(") return "var(--aurora-accent-primary)"
66 return undefined
67}
68
69function highlight(code: string): React.ReactNode[] {
70 const out: React.ReactNode[] = []
71 let match: RegExpExecArray | null
72 TOKEN_RE.lastIndex = 0
73 let key = 0
74 // Track the last non-whitespace token to resolve member-access / call coloring.
75 let prevSig = ""
76 // Pre-scan to know the "next significant" char for each identifier.
77 const tokens: { text: string; type: number }[] = []
78 while ((match = TOKEN_RE.exec(code)) !== null) {
79 if (match[1]) tokens.push({ text: match[1], type: 1 })
80 else if (match[2]) tokens.push({ text: match[2], type: 2 })
81 else if (match[3]) tokens.push({ text: match[3], type: 3 })
82 else if (match[4]) tokens.push({ text: match[4], type: 4 })
83 else if (match[5]) tokens.push({ text: match[5], type: 5 })
84 else tokens.push({ text: match[6] ?? "", type: 6 })
85 }
86// … truncated

What it pulls in

npm packages

  • lucide-react@^0.487.0

Other registry items

  • @aurora/aurora-tokens
  • @aurora/aurora-ai-elements

Files it writes

  • registry/aurora/blocks/ai/elements/snippet.tsx

Facts

Registry
aurora
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
today

Go to the source

aurora.dinglebear.ai dinglebear-ai/aurora on GitHub Raw registry item This item as JSON

More from aurora

All 176 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Aurora AI Actionaurora-ai-actionauroraBlocksFree1 dep
Aurora AI Actionsaurora-ai-actionsauroraBlocksFree1 dep
Aurora AI Agentaurora-ai-agentauroraBlocksFree1 dep
Aurora AI Image Gridaurora-ai-ai-image-gridauroraBlocksFree1 dep
Aurora AI Attachmentsaurora-ai-attachmentsauroraBlocksFree1 dep
Aurora AI Audio Playeraurora-ai-audio-playerauroraBlocksFree1 dep
Aurora AI Branchaurora-ai-branchauroraBlocksFree1 dep
Aurora AI Canvasaurora-ai-canvasauroraBlocksFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex