MCPcopy Create free account
hub / github.com/SyntaxUI/syntaxui / Anchor

Function Anchor

src/components/Heading.tsx:43–67  ·  view source on GitHub ↗
({
  id,
  inView,
  children,
}: {
  id: string
  inView: boolean
  children: React.ReactNode
})

Source from the content-addressed store, hash-verified

41}
42
43function Anchor({
44 id,
45 inView,
46 children,
47}: {
48 id: string
49 inView: boolean
50 children: React.ReactNode
51}) {
52 return (
53 <Link
54 href={`#${id}`}
55 className="group text-inherit no-underline hover:text-inherit"
56 >
57 {inView && (
58 <div className="absolute ml-[calc(-1*var(--width))] mt-1 hidden w-[var(--width)] opacity-0 transition [--width:calc(2.625rem+0.5px+50%-min(50%,calc(theme(maxWidth.lg)+theme(spacing.8))))] group-hover:opacity-100 group-focus:opacity-100 md:block lg:z-50 2xl:[--width:theme(spacing.10)]">
59 <div className="group/anchor block h-5 w-5 rounded-lg bg-zinc-50 ring-1 ring-inset ring-zinc-300 transition hover:ring-zinc-500 dark:bg-zinc-800 dark:ring-zinc-700 dark:hover:bg-zinc-700 dark:hover:ring-zinc-600">
60 <AnchorIcon className="h-5 w-5 stroke-zinc-500 transition dark:stroke-zinc-400 dark:group-hover/anchor:stroke-white" />
61 </div>
62 </div>
63 )}
64 {children}
65 </Link>
66 )
67}
68
69export function Heading<Level extends 2 | 3>({
70 children,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected