Sections
Getting Started
Components
- DocTabs
- Callout
- ComponentPreview
- CommandMenu
- CopyButton
- DocsSidebar
- DocsTableOfContents
- PageHeader
- SiteHeader
- CopyCodeButton
- DocsCopyPage
- CodeBlockCommand
- CommandMenuItem
- CommandMenuKbd
- GitHubLink
- LucideIcon
- MainNav
- MobileNav
- ModeSwitcher
- PageHeaderDescription
- PageHeaderHeading
- SiteBody
- SiteConfig
- SiteFooter
- OgImage (Custom)
The MainNav component provides horizontal desktop navigation.
Usage
<script setup lang="ts">
import { MainNav } from '@/components/MainNav'
const items = [
{ href: "/docs", name: "Docs" },
{ href: "/blog", name: "Blog" },
]
</script>
<template>
<MainNav :items="items" />
</template>Features
- Horizontal layout for desktop
- Active state highlighting
- Hover effects
- Responsive (hidden on mobile)
API Reference
MainNav
| Prop | Type | Description |
|---|---|---|
items | { href: string; name: string }[] | Navigation items array |
class | HTMLAttributes["class"] | Custom CSS classes |
Styling
- Active link uses
text-primary - Inactive links use
text-muted-foreground - Hover effect with
hover:text-primary - Ghost button variant
Configuration
Typically uses MAIN_NAVIGATION from app/lib/navigation.ts:
export const MAIN_NAVIGATION = [
{ href: "/docs", name: "Docs" },
]