Skip to content

Commit

Permalink
feat: icons in the navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
TitusKirch committed Dec 23, 2024
1 parent d9b6d7e commit 20d9a7b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
2 changes: 2 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ export default defineAppConfig({
title: 'Getting Started',
to: '/getting-started',
description: 'Start building your document with shadcn-docs-nuxt',
icon: 'lucide:book',
}, {
title: 'API',
to: '/api',
description: 'Discover the configurations and exposed APIs.',
target: '_self',
icon: 'lucide:code',
}],
}, {
title: 'Credits',
Expand Down
16 changes: 10 additions & 6 deletions components/layout/Header/Nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
<NuxtLink
:to="link.to"
:target="link.target"
class="mb-1 block w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
class="mb-1 flex w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
>
<div class="font-semibold">
{{ link.title }}
</div>
<div class="text-sm text-muted-foreground">
{{ link.description }}
<SmartIcon v-if="link?.icon" :name="link.icon" :size="16" class="mt-1 min-w-5" />

<div>
<div class="font-semibold">
{{ link.title }}
</div>
<div class="text-sm text-muted-foreground">
{{ link.description }}
</div>
</div>
</NuxtLink>
</li>
Expand Down
16 changes: 10 additions & 6 deletions components/layout/Header/NavMobileItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
<NuxtLink
:to="link.to"
:target="link.to"
class="mb-1 block w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
class="mb-1 flex w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
>
<div class="font-semibold">
{{ link.title }}
</div>
<div class="text-sm text-muted-foreground">
{{ link.description }}
<SmartIcon v-if="link.icon" :name="link.icon" :size="16" class="mt-1 min-w-5" />

<div>
<div class="font-semibold">
{{ link.title }}
</div>
<div class="text-sm text-muted-foreground">
{{ link.description }}
</div>
</div>
</NuxtLink>
</li>
Expand Down
2 changes: 1 addition & 1 deletion content/3.api/1.configuration/1.shadcn-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface ILink {

interface INav {
title: string;
links?: (ILink & { description: string })[];
links?: (ILink & { description: string; icon: string })[];
to?: string;
target?: Target;
}
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface DefaultConfig {
to: string;
target: string;
description: string;
icon?: string;
})[];
})[];
links: ({
Expand Down

0 comments on commit 20d9a7b

Please sign in to comment.