@@ -8,65 +8,88 @@ import { SimLogoFull } from '@/components/ui/sim-logo'
88import { ThemeToggle } from '@/components/ui/theme-toggle'
99import { cn } from '@/lib/utils'
1010
11+ const NAV_TABS = [
12+ {
13+ label : 'Documentation' ,
14+ href : '/introduction' ,
15+ match : ( p : string ) => ! p . includes ( '/api-reference' ) ,
16+ external : false ,
17+ } ,
18+ {
19+ label : 'API Reference' ,
20+ href : '/api-reference/getting-started' ,
21+ match : ( p : string ) => p . includes ( '/api-reference' ) ,
22+ external : false ,
23+ } ,
24+ { label : 'Mothership' , href : 'https://sim.ai' , external : true } ,
25+ ] as const
26+
1127export function Navbar ( ) {
1228 const pathname = usePathname ( )
13- const isApiReference = pathname . includes ( '/api-reference' )
1429
1530 return (
16- < nav className = 'sticky top-0 z-50 border-border/50 border-b bg-background/80 backdrop-blur-md backdrop-saturate-150' >
17- { /* Desktop: Single row layout */ }
18- < div className = 'hidden h-16 w-full items-center lg:flex' >
31+ < nav className = 'sticky top-0 z-50 bg-background/80 backdrop-blur-md backdrop-saturate-150' >
32+ < div className = 'hidden w-full flex-col lg:flex' >
33+ { /* Top row: logo, search, controls */ }
1934 < div
20- className = 'relative flex w-full items-center justify-between'
35+ className = 'flex h-[52px] w-full items-center justify-between'
2136 style = { {
2237 paddingLeft : 'calc(var(--sidebar-offset) + 32px)' ,
2338 paddingRight : 'calc(var(--toc-offset) + 60px)' ,
2439 } }
2540 >
26- { /* Left cluster: logo */ }
27- < div className = 'flex items-center' >
28- < Link href = '/' className = 'flex min-w-[100px] items-center' >
29- < SimLogoFull className = 'h-7 w-auto' />
30- </ Link >
31- </ div >
41+ < Link href = '/' className = 'flex min-w-[100px] items-center' >
42+ < SimLogoFull className = 'h-7 w-auto' />
43+ </ Link >
3244
33- { /* Center cluster: search - absolutely positioned to center */ }
3445 < div className = '-translate-x-1/2 absolute left-1/2 flex items-center justify-center' >
3546 < SearchTrigger />
3647 </ div >
3748
38- { /* Right cluster aligns with TOC edge */ }
3949 < div className = 'flex items-center gap-1' >
40- < Link
41- href = '/introduction'
42- className = { cn (
43- 'rounded-xl px-3 py-2 font-normal text-[0.9375rem] leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground' ,
44- ! isApiReference ? 'text-foreground' : 'text-foreground/60'
45- ) }
46- >
47- Documentation
48- </ Link >
49- < Link
50- href = '/api-reference/getting-started'
51- className = { cn (
52- 'rounded-xl px-3 py-2 font-normal text-[0.9375rem] leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground' ,
53- isApiReference ? 'text-foreground' : 'text-foreground/60'
54- ) }
55- >
56- API
57- </ Link >
58- < Link
59- href = 'https://sim.ai'
60- target = '_blank'
61- rel = 'noopener noreferrer'
62- className = 'rounded-xl px-3 py-2 font-normal text-[0.9375rem] text-foreground/60 leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground'
63- >
64- Platform
65- </ Link >
6650 < LanguageDropdown />
6751 < ThemeToggle />
6852 </ div >
6953 </ div >
54+
55+ { /* Divider — only spans content width */ }
56+ < div
57+ className = 'border-b'
58+ style = { {
59+ marginLeft : 'calc(var(--sidebar-offset) + 32px)' ,
60+ marginRight : 'calc(var(--toc-offset) + 60px)' ,
61+ borderColor : 'rgba(128, 128, 128, 0.1)' ,
62+ } }
63+ />
64+
65+ { /* Bottom row: navigation tabs — border on row, tabs overlap it */ }
66+ < div
67+ className = 'flex h-[42px] items-stretch gap-6 border-border/20 border-b'
68+ style = { {
69+ paddingLeft : 'calc(var(--sidebar-offset) + 32px)' ,
70+ } }
71+ >
72+ { NAV_TABS . map ( ( tab ) => {
73+ const isActive = ! tab . external && tab . match ( pathname )
74+ return (
75+ < Link
76+ key = { tab . label }
77+ href = { tab . href }
78+ { ...( tab . external ? { target : '_blank' , rel : 'noopener noreferrer' } : { } ) }
79+ className = { cn (
80+ '-mb-px relative flex items-center border-b text-[14px] tracking-[-0.01em] transition-colors' ,
81+ isActive
82+ ? 'border-neutral-400 font-[550] text-neutral-800 dark:border-neutral-500 dark:text-neutral-200'
83+ : 'border-transparent font-medium text-fd-muted-foreground hover:border-neutral-300 hover:text-neutral-600 dark:hover:border-neutral-600 dark:hover:text-neutral-400'
84+ ) }
85+ >
86+ { /* Invisible bold text reserves width to prevent layout shift */ }
87+ < span className = 'invisible font-[550]' > { tab . label } </ span >
88+ < span className = 'absolute' > { tab . label } </ span >
89+ </ Link >
90+ )
91+ } ) }
92+ </ div >
7093 </ div >
7194 </ nav >
7295 )
0 commit comments