Skip to content

Commit cb82098

Browse files
committed
feat: add icon support to logo context menu
1 parent 9670d2f commit cb82098

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

docs/vitepress-theme/guide/vitepress-integration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,19 @@ export const themeConfig = {
133133
items: [
134134
{
135135
label: 'View on GitHub',
136+
icon: 'i-tabler:brand-github',
136137
href: 'https://github.com/your-org/your-repo'
137138
},
138139
{
139140
label: 'Report Issue',
141+
icon: 'i-tabler:bug',
140142
onClick: () => {
141143
window.open('https://github.com/your-org/your-repo/issues/new', '_blank')
142144
}
143145
},
144146
{
145147
label: 'Documentation',
148+
icon: 'i-tabler:book',
146149
href: 'https://docs.example.com'
147150
}
148151
]
@@ -162,6 +165,7 @@ export const themeConfig = {
162165
- Custom menu items to display
163166
- Each item can have:
164167
- `label` (required): Text to display
168+
- `icon` (optional): Icon class (e.g., `i-tabler:brand-github`, `i-nimiq:star`)
165169
- `href` (optional): URL to open in a new tab
166170
- `onClick` (optional): Function to execute when clicked
167171

packages/nimiq-vitepress-theme/src/layout/Logo.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ if (typeof window !== 'undefined') {
115115
hover="bg-neutral-100 dark:bg-neutral-700"
116116
transition-colors
117117
cursor-pointer
118+
flex="~ items-center gap-8"
118119
@click="handleItemClick(item)"
119120
>
120-
{{ item.label }}
121+
<div v-if="item.icon" :class="item.icon" text-16 />
122+
<span>{{ item.label }}</span>
121123
</button>
122124
</div>
123125
</Teleport>

packages/nimiq-vitepress-theme/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface OutlineAction {
4848

4949
export interface LogoContextMenuItem {
5050
label: string
51+
icon?: string
5152
onClick?: () => void
5253
href?: string
5354
}

0 commit comments

Comments
 (0)