sidebar-link.tsx

src/components/sidebar-stack/sidebar-link.tsx
import type { ReactNode } from 'react'
export interface SidebarLinkProps {
children: ReactNode
componentId: string
title: string
className?: string
/** Show title immediately instead of fading in on scroll */
showTitleImmediately?: boolean
}
/**
* A declarative link component for sidebar navigation.
* Does not use hooks - works with SidebarClickHandler via event delegation.
*/
export function SidebarLink({
children,
componentId,
title,
className = '',
showTitleImmediately,
}: SidebarLinkProps) {
// Note: onClick is handled by SidebarClickHandler via event delegation
// The href uses a dash separator to avoid CSS selector issues with colons
return (
<a
href={`#sidebar-panel-${componentId}`}
data-sidebar-title={title}
data-sidebar-component={componentId}
data-sidebar-show-title={showTitleImmediately ? 'true' : undefined}
className={className}
>
{children}
</a>
)
}

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC