Glass TOC
washiveil/glass-tocFreeComponent
On-this-page navigation card with active-item highlight.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-toc.jsonSource
1import { cn } from '@/lib/utils';23export interface GlassTOCItem {4 label: string;5 href: string;6 active?: boolean;7}89export interface GlassTOCProps extends Omit<React.ComponentProps<'nav'>, 'title'> {10 title?: string;11 items: GlassTOCItem[];12}1314export function GlassTOC({ title = 'On this page', items, className, ...props }: GlassTOCProps) {15 return (16 <nav17 className={cn('rounded-2xl border border-glass-border bg-glass p-5 text-[0.8125rem] backdrop-blur-xl', className)}18 {...props}19 >20 <p className="font-mono text-[0.75rem] tracking-[0.2em] text-muted-foreground uppercase">{title}</p>21 <ul className="mt-3 space-y-2 text-muted-foreground">22 {items.map((item) => (23 <li key={item.href}>24 <a href={item.href} className={item.active ? 'text-ruri dark:text-ruri-soft' : 'hover:text-foreground'}>25 {item.label}26 </a>27 </li>28 ))}29 </ul>30 </nav>31 );32}
What it pulls in
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Alert Dialogglass-alert-dialog | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Avatarglass-avatar | washiveil | Components | Free | 1 dep |
